Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Domain Values in Hibernate

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I am facing a problem when mapping domain classes to a database table in hibernate.

I am following a domain driven approach, so a class would look like this:



Now, is there a common way to map domain values to their corresponding database columns?

what i have done so far is using the <component> element like this



and this works. however, i also use domain values for id properties that are usually mapped like this:



this expects a primitive id type, such as Long. However, if I used the type MessageID as a domain value, i don't know how to do the mapping, as the component element does not support an id element in it's body.

Hope somebody can help.

Best regards

Sebastian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic