Create a new Version

This example show how to create a new PrimaryDataEntityVersion for a PrimaryDataEntity by saving a new MetaData set for this PrimaryDataEntity.

...
/* create new empty MetaData object from ImplementationProvider */

	MetaData directoryMetaData = myImplementationProvider.createMetaDataInstance();

/* getting the MetaData object from the existing set */

	MetaData directoryMetaData = myDirectory.getMetaData();

/* set some new meta data values */

	directoryMetaData.setElementValue(EnumDublinCoreElements.TITLE, new UntypedData("The e!DAL JAVA API: Sharing and Citing Research Data in Life Sciences "));
	
	directoryMetaData.setElementValue(EnumDublinCoreElements.CREATOR, new NaturalPerson("Daniel", "Arend", "Stadt Seeland, OT Gatersleben, Corrensstraße 3", "06466", "Germany"));
	
	directoryMetaData.setElementValue(EnumDublinCoreElements.DESCRIPTION, new UntypedData("e!DAL Poster"));

/* set meta data generate automatically a new version for this object */

	myDirectory.setMetaData(directoryMetaData);

	System.out.println(directoryMetaData);
...

Now the output looks like this:

D. Arend (2014-09-08): The e!DAL JAVA API: Sharing and Citing Re .... 
You can use the clone() function of the MetaData class to create a new object with the same values and then change this values.