ObjectDB ObjectDB

@Column( name = "columnName") doesn't work

#1

I have created following entity class with custom fields


@Entity
public class AfwDataKey
{
   @Id
   @GeneratedValue
   @Column(name = "KEY_ID")
   private long id;
   private Long timestamp;

   @ManyToOne
   @Column(name = "KEY_DESCRIPTOR")
   private AfwKeyDescriptor keyDescriptor;

   @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
   @Column( name = "DATA_ITEMS" )
   private List<AfwDataKeyItem> dataItems;

   @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
   private AfwCodedDataBlock codedDataBlock;

   private int level;

.....

}

And expected that after import data to DB, fields must be with following names:

KEY_ID,
timestamp,
KEY_DESCRIPTOR,
DATA_ITEMS,
codedDataBlock,
level

but them still not correctly mapped and stays like member defined in class

id,
timestamp,
keyDescriptor,
dataItems,
codedDataBlock,
level

I have used the 2.5.1 & the latest 2.5.5 objectDb version and both of them work the same. Could you explain how can I fix this problem?

edit
delete
#2

ORM/SQL annotations are silently ignored by ObjectDB (as indicated for example on the Column annotation doc page).

When you use ObjectDB, you only have the names of the fields in your Java classes, with no mapping.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.