Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How to map a class that has an object that is defined as @Embeddable

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a class called Organization. This Organization class has 4 fields that are of type EPhoneEntry. This EPhoneEntry class has an annotation above the class declaration of @Embeddable. Anyone have an example of how to create the hbm.XML mapping file for a class similar to my organization class? My problem is when I run a piece of HQL within the "HQL Console" in the "IntelliJ IDEA" IDE it returns this error:

hql> from AdminValue
java.lang.RuntimeException: org.hibernate.MappingException: Repeated column in mapping for entity: com.bah.englink.ejb.Organization column: phoneType_ID (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(
at org.hibernate.mapping.PersistentClass.validate(
at org.hibernate.mapping.RootClass.validate(
at org.hibernate.cfg.Configuration.validate(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(

neither the Organization or the EPhoneEntry class contain a field (phoneType_ID) that is mentioned in the above error but I'm quessing that this problem stems from me mapping the Organization class wrong. I mapped the Organization class as follows in my "" files:

and this is the EPhoneEntry class:
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic