Finally did resolve the problem! With OpenJPA, maps-id must be equal to "". -->no space While EclipseLink maps-id must be equal to " ". -->two spaces Otherwise EclipseLink throws the following exception (and OpenJPA the one I finally found the solution):
> [EL Severe]: 2010-12-09 > 15:22:50.01--ServerSession(534353)--Thread(Thread[main,5,main])--Local > Exception Stack: > Exception [EclipseLink-0] (Eclipse Persistence Services - > 2.1.1.v20100817-r8050): > org.eclipse.persistence.exceptions.IntegrityException > Descriptor Exceptions: > --------------------------------------------------------- > > Exception [EclipseLink-48] (Eclipse Persistence Services - > 2.1.1.v20100817-r8050): > org.eclipse.persistence.exceptions.DescriptorException > Exception Description: Multiple writable mappings exist for the field > [customer.person_id]. Only one may be defined as writable, all others > must be specified read-only. > Mapping: org.eclipse.persistence.mappings.OneToOneMapping[person] > Descriptor: RelationalDescriptor(park.model.Customer --> > [DatabaseTable(customer)]) > > Exception [EclipseLink-48] (Eclipse Persistence Services - > 2.1.1.v20100817-r8050): > org.eclipse.persistence.exceptions.DescriptorException > Exception Description: Multiple writable mappings exist for the field > [employee.person_id]. Only one may be defined as writable, all others > must be specified read-only. > Mapping: org.eclipse.persistence.mappings.OneToOneMapping[naturalPerson] > Descriptor: RelationalDescriptor(park.model.Employee --> > [DatabaseTable(employee)]) > Hibernate doesn't work (with or without space), throwing: > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.914 sec > <<< FAILURE! > findAll(park.model.EmployeeTest) Time elapsed: 0.02 sec <<< ERROR! > javax.persistence.PersistenceException: > org.hibernate.id.IdentifierGenerationException: ids for this class must be > manually assigned before calling save(): park.model.Employee > at > org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1235) > at > org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168) > at > org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1174) > at > org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:674) > at park.model.EmployeeTest.findAll(EmployeeTest.java:116) > I think that option(MapsId using orm.xml file, I'm not using annotation) was not implemented yet in the hibernate (3.5.6-final). Regards, Gilberto -- View this message in context: http://openjpa.208410.n2.nabble.com/Using-orm-xml-table-generator-Strange-Column-TABLE-NAME0-tp5809308p5820092.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
