Embedded Elements in ORM Mapping

2008-09-17 Thread PLC_David
Hi, I used OpenJPA because I can't realized the mapping with annotations. So I use the orm.xml for my mapping. Now my Problem: I have an other class in my entity which contains an other class. But I can't found the embedded element in an embedded element into orm_1_0.xsd. How I can write this

Transaction question

2008-09-17 Thread ericp56
I am porting an application to container-managed JPA. In my EJB, I now have a function that does something like this: function CreateAccount() { Person p = new Person(); Address a = new Address(); ... em.persist(p); em.persist(a) ... } In my Web page that uses the EJB, I have added a

Example of Enum mapping (fixed numbering)

2008-09-17 Thread Michael Vorburger
Does anybody have a concrete example of how to map an enum with fixed ordinal numbering? I have a DB which has an numeric column where the existing values mean something. I want to map that to an Entity attribute of some enum type. Reading

Re: Example of Enum mapping (fixed numbering)

2008-09-17 Thread Fay Wang
Here is an example: @Entity public class EntityA { @Id private int id; @Enumerated( EnumType.ORDINAL ) private Measure measure; public Measure getMeasure() { return measure; } public void setMeasure(Measure measure) { this.measure = measure;