Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to create History for @ElementCollection?
How to create History for @ElementCollection? [message #1197597] Wed, 20 November 2013 00:36
Gilberto Rodriguez is currently offline Gilberto RodriguezFriend
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;

.....

}




Previous Topic:EclipseLink 2.5 JPA + MONGODB and ORDER BY
Next Topic:Context-sensitive composite primary keys
Goto Forum:
  


Current Time: Wed Nov 26 20:23:40 GMT 2014

Powered by FUDForum. Page generated in 0.01400 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software