aspose file tools*
The moose likes Object Relational Mapping and the fly likes Unknown entity: java.util.ArrayList ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unknown entity: java.util.ArrayList ??? " Watch "Unknown entity: java.util.ArrayList ??? " New topic
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: 9329
    
110


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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unknown entity: java.util.ArrayList ???
 
Similar Threads
Not able to get mapped object Set in hibernate
XMLEncoder not serializing the whole graph!
hibernate one to many reationship.
Primary key / Forign Key
One to many Relation