Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate List

 
Jane Feenon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have just started hibernate eclipse.
I have a class called EventManager which imports org.hibernate.mapping.List;
for the listEvents() method.
when running the build file I get the error:
incompatible types
found java.util.List
required org.hibernate.mapping.List
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just started hibernate eclipse.
I have a class called EventManager which imports org.hibernate.mapping.List;
for the listEvents() method.


I am not aware of this class, but going by the error you are seeing, i would suggest changing the

imports org.hibernate.mapping.List;


to

 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not use hibernate collection classes in your business model. It ties this part of your code to hibernate.
If you code against the standard collection interfaces (java.util.List, java.util.Set, java.util.Map, ...) then everything will work fine (this does not only apply to hibernate/collections: code to the interface)

When Hibernate loads a entity from the DB, it will use it's own implementation for the collections (in order to provide lazy loading) but you should not have a problem with this because you code to the interface.


Pascal
 
Jane Feenon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic