Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Many to many self join using hibernate annotation

 
Muhammad Ramahy
Greenhorn
Posts: 11
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want to create a self join many to many relation like in twitter user and follower where follower could follow many users and user could have many followers

so in the User Entity I put it like this


and in the database I have two tables:
User
username(ID)
password
email

user_follower
username(ID)
follower(ID)

the problem is that I get this exception:

The problem is that I don't know where the exception is thrown as my tomcat couldn't be initialized in debug mode but that's another issue
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
org.hibernate.LazyInitializationException

Have you searched for the documentation of this Exception? Because there is a lot of documentation about it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic