• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Unknown entity: java.util.ArrayList ???

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does MemberEnt represent a composite key? If so this needs to be serializable.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exception message do you see?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic