File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unknown entity: java.util.ArrayList ???

 
Joshua Elkino
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've been googling this problem, but i cannot resolve it. I have a DB insert class that will insert initial values to the DB for testing purposes.



Its crashing at the session save and i have no idea why.

here is my CategoryEnt with the setters not mentioned


I also get this with a few other classes, but this is the simplest so i figured try to fix this first.

Also i was getting a weird error before "Could not determine type for: com.prosper.model.MemberEnt" until i made the class serializable. Do i need to make ALL my classes serializable?
Using hibernate 3.2 w/ mysql 5
Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does MemberEnt represent a composite key? If so this needs to be serializable.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt think it did. I am referencing MemberEnt from other classes but every class has an @Id except for the Embeddable classes. What about my initial problem? any suggestions?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exception message do you see?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

private ArrayList<CategoryEnt> categorys = new ArrayList<CategoryEnt>();
.....
session.save(categorys);


You cannot pass a collection of objects to the session object for persisting. As per the Session javadoc, the save accepts a Object of the persistent class (in your example, the CategoryEnt)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic