| Author |
Unknown entity: java.util.ArrayList ???
|
Joshua Elkino
Ranch Hand
Joined: Jul 24, 2007
Posts: 91
|
|
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
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Does MemberEnt represent a composite key? If so this needs to be serializable.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Joshua Elkino
Ranch Hand
Joined: Jul 24, 2007
Posts: 91
|
|
|
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
Joined: Apr 14, 2004
Posts: 10336
|
|
|
What exception message do you see?
|
 |
Joshua Elkino
Ranch Hand
Joined: Jul 24, 2007
Posts: 91
|
|
|
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8212
|
|
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)
|
[My Blog] [JavaRanch Journal]
|
 |
 |
|
|
subject: Unknown entity: java.util.ArrayList ???
|
|
|