Announcement Announcement Module
No announcement yet.
Persisting Spring beans through hibernate Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Persisting Spring beans through hibernate


    I am a newbie, and I have a question when using hibernate within Spring.

    I first made the classes to persist, by making them Spring beans (defined in the bean config file).
    I defined the classes with interfaces, and I accessed the classes through ApplicationContext.getBean()
    Now, the problem was that I got "net.sf.hibernate.MappingException:Unknown entity class...." when saving the class instance.

    So, I tried making the classes to persist ordinary classes, and this worked fine.

    Question is: should the first approach have worked?

    Thanks for any insight!