Hi, 

I met a question when config N-1 Unidirectional Join table and want to specific 
table name and field name.
My classes as below:


1. Department class   


@javax.jdo.annotations.PersistenceCapable(
        table="t_depart",
        identityType= IdentityType.APPLICATION
)

@DomainObject()
public class Department {
      
       @javax.jdo.annotations.PrimaryKey
       
@javax.jdo.annotations.Persistent(primaryKey="true",valueStrategy=javax.jdo.annotations.IdGeneratorStrategy.UUIDHEX)
       @javax.jdo.annotations.Column(jdbcType="CHAR",length=32)
       @Getter @Setter
       private String id;


       ......
}


2. Device class


@javax.jdo.annotations.PersistenceCapable(
                table="t_device",
                identityType=IdentityType.APPLICATION
)

@DomainObject()
public class Device {
       @javax.jdo.annotations.PrimaryKey
       
@javax.jdo.annotations.Persistent(primaryKey="true",valueStrategy=javax.jdo.annotations.IdGeneratorStrategy.UUIDHEX)
       @javax.jdo.annotations.Column(jdbcType="CHAR",length=32)
       private String id


               
       @Getter @Setter
       private Department department;
       ............
}


I need specify join table name as t_device_depart and  fields named as 
device_id and depart_id.
Department know nothing about Device.
I try several config describe below page
http://www.datanucleus.org/products/datanucleus/jdo/mapping.html#one_many_join_uni


for example use @Persistent() with  @Join(table = "t_devcie_depart")
or @Persistent(table = "t_devcie_depart")
but it can not work. sometimes it create new table with name 
device_department.,sometimes it create its own field name like id_oid and id_eid


Does any one success config N-1 Unidirectional Join table and can specify table 
name and field name?


Best Regards,
James

Reply via email to