How to create History for @ElementCollection? [message #1197597] |
Wed, 20 November 2013 00:36 |
Gilberto Rodriguez Messages: 1 Registered: November 2013 |
Junior Member |
|
|
Hi,
I have been trying to create History for an @ElementCollection field but according to the documentation of the historyPolicy class: Descriptors, ManyToManyMappings, DirectCollectionMappings,
and DirectMapMappings only can have a history policy, as only they have associated
database tables. ElementCollections are of type AggregateCollectionMapping in the eclipselink world, and do not have a way to set a history policy. Does any one have successfully created history for element collections???
Here is an example of my code:
@Entity(name = "Test")
@Table(name = "TEST")
public class Test{
@ElementCollection(targetClass=CollTest.class)
@CollectionTable(name = "COLL_TEST", joinColumns = @JoinColumn(name = "TEST_ID"))
@OrderColumn
private List<CollTest> testList;
....
}
@Embeddable
public class CollTest implements Serializable {
@Column(name = "RECORDID", updatable=true)
private String id;
@Column(name = "TEXT", nullable = true, length=4000 )
private String text;
@Column(name = "LANGUAGE", nullable = false, length=64 )
private String language;
.....
}
|
|
|
Powered by
FUDForum. Page generated in 0.02282 seconds