Toplink can use read-only mappings when several attributes on the feature map correspond to the same fields in the database, but only one of the mappings can write to the field.
Does JPA have a feature like writing annotations? I have one @ManyToOne and one @Column annotation that need to be mapped to the same field in the database.
@ManyToOne (optional = false, fetch = FetchType.LAZY)
@JoinColumn (name = "USR_ID", referencedColumnName = "USER_ID", nullable = false)
private user user;
/ ** @generated ** /
@Column (name = "USER_ID", nullable = false, length = 30)
private String userId;
java jpa
Jackie dong
source share