• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Problem using Hibernate CompositeUserType

Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to use HibernateCompositeUser type to handle i18n specific data in my application. i am trying to use the below approach.

I have a table named master table which contains all locale independent data while i have created another table master_translation which contains all locale sensitive information. Master table contains a reference to the master_translation.here is the detailed table structure

now i am using HibernateCompositeUser type to handle this internal process. here is the mapping for master class.

where type="masteri18n" is hibernate CompositeUserType.now when i am fetching the master content it is correctly fetching the data based on the language and my Master class contain a reference to the Master_translation which holding locale specific data. Problem getting started when i am trying to insert the data in to the respectice tables.Here is a code snap shot from the CompositeUserType

what i am trying to do is first saving my Master_i18n and den set it reference in to the Master Though Master_i18n getting saved properly but when it comes to the Master itself hibernate is creating SQL for all the fields which are defined in the Master_i18n

and finally its throwing the following exception

i have just started getting familiar with Custom mapping type so not sure what exactly i am doing wrong. Any help/pointer in this regard will be much helpful.
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic