• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Persisting model

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm creating application who contains two model class Student and Grade and using org.springframework.orm.hibernate3.LocalSessionFactoryBean to persist them
The two model class and the relation between them is:


I've manage to persist the two classes separable with out the relation between(the composition in Student class)
I'm wondering is there something like

that like a state to put it in the hibernate-mapping and make the persistence with the corresponding relation.
I'm not using JPA Annotation in the model and my tables in the database are

Student table:


Grade table:
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you just add the association mapping to your mapping.

See the Hibernate documentation for xml mapping of associations here
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/associations.html#assoc-unidirectional

I am also going to move this to the ORM forum as this isn't a Spring question. Thanks

Mark
 
Aleksandar Mitrev
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:Well, you just add the association mapping to your mapping.

See the Hibernate documentation for xml mapping of associations here
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/associations.html#assoc-unidirectional

I am also going to move this to the ORM forum as this isn't a Spring question. Thanks

Mark



Thanks mark your reply gave me direction what my mistake is
I was getting error on one-to-many declaration and a assuming that my mistake is there but actual my mistake was that I've didn't added the spring-jpa jar
Thanks again
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aleksandar Mitrev wrote:

Mark Spritzler wrote:Well, you just add the association mapping to your mapping.

See the Hibernate documentation for xml mapping of associations here
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/associations.html#assoc-unidirectional

I am also going to move this to the ORM forum as this isn't a Spring question. Thanks

Mark



Thanks mark your reply gave me direction what my mistake is
I was getting error on one-to-many declaration and a assuming that my mistake is there but actual my mistake was that I've didn't added the spring-jpa jar
Thanks again



Sweet. Good Job.

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic