use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class ProjectProject method buildBudgetDescriptor.
/**
* TopLink generated method.
* <b>WARNING</b>: This code was generated by an automated tool.
* Any changes will be lost when the code is re-generated
*/
protected void buildBudgetDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
// SECTION: DESCRIPTOR
descriptor.setJavaClass(org.eclipse.persistence.testing.models.multipletable.Budget.class);
Vector vector = new Vector();
vector.addElement("BUDGET");
descriptor.setTableNames(vector);
descriptor.addPrimaryKeyFieldName("BUDGET.ID");
// SECTION: PROPERTIES
descriptor.setIdentityMapClass(org.eclipse.persistence.internal.identitymaps.FullIdentityMap.class);
descriptor.setSequenceNumberName("BUDG_SEQ");
descriptor.setSequenceNumberFieldName("ID");
descriptor.setExistenceChecking("Check cache");
descriptor.setIdentityMapSize(100);
// SECTION: COPY POLICY
descriptor.createCopyPolicy("constructor");
// SECTION: INSTANTIATION POLICY
descriptor.createInstantiationPolicy("constructor");
// SECTION: DIRECTTOFIELDMAPPING
org.eclipse.persistence.mappings.DirectToFieldMapping directtofieldmapping = new org.eclipse.persistence.mappings.DirectToFieldMapping();
directtofieldmapping.setAttributeName("amount");
directtofieldmapping.setIsReadOnly(false);
directtofieldmapping.setFieldName("BUDGET.AMNT");
descriptor.addMapping(directtofieldmapping);
// SECTION: DIRECTTOFIELDMAPPING
org.eclipse.persistence.mappings.DirectToFieldMapping directtofieldmapping1 = new org.eclipse.persistence.mappings.DirectToFieldMapping();
directtofieldmapping1.setAttributeName("currency");
directtofieldmapping1.setIsReadOnly(false);
directtofieldmapping1.setFieldName("BUDGET.CUR");
descriptor.addMapping(directtofieldmapping1);
// SECTION: DIRECTTOFIELDMAPPING
org.eclipse.persistence.mappings.DirectToFieldMapping directtofieldmapping2 = new org.eclipse.persistence.mappings.DirectToFieldMapping();
directtofieldmapping2.setAttributeName("id");
directtofieldmapping2.setIsReadOnly(false);
directtofieldmapping2.setFieldName("BUDGET.ID");
descriptor.addMapping(directtofieldmapping2);
addDescriptor(descriptor);
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class ObjectVersion method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
// SECTION: DESCRIPTOR
descriptor.setJavaClass(ObjectVersion.class);
Vector vector = new Vector();
vector.addElement("AO_LCK");
descriptor.setTableNames(vector);
// SECTION: PROPERTIES
descriptor.setIdentityMapClass(org.eclipse.persistence.internal.identitymaps.FullIdentityMap.class);
descriptor.setExistenceChecking("Check cache");
descriptor.setIdentityMapSize(100);
descriptor.descriptorIsAggregate();
// SECTION: DIRECTTOFIELDMAPPING
org.eclipse.persistence.mappings.DirectToFieldMapping directtofieldmapping = new org.eclipse.persistence.mappings.DirectToFieldMapping();
directtofieldmapping.setAttributeName("id");
directtofieldmapping.setIsReadOnly(false);
directtofieldmapping.setFieldName("AO_LCK.AGG_VERSION");
descriptor.addMapping(directtofieldmapping);
// SECTION: DIRECTTOFIELDMAPPING
org.eclipse.persistence.mappings.DirectToFieldMapping directtofieldmapping2 = new org.eclipse.persistence.mappings.DirectToFieldMapping();
directtofieldmapping2.setAttributeName("versionInfo");
directtofieldmapping2.setIsReadOnly(false);
directtofieldmapping2.setFieldName("AO_LCK.AGG_INFO");
descriptor.addMapping(directtofieldmapping2);
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class TimestampInAggregateObject method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(TimestampInAggregateObject.class);
descriptor.setTableName("TSAO_LCK");
descriptor.setPrimaryKeyFieldName("ID");
descriptor.setSequenceNumberName("SEQ");
descriptor.setSequenceNumberFieldName("ID");
descriptor.useTimestampLocking("AGG_VERSION", false);
/* Next define the attribute mappings. */
descriptor.addDirectMapping("id", "ID");
descriptor.addDirectMapping("value", "A_VALUE");
// SECTION: AGGREGATEOBJECTMAPPING
org.eclipse.persistence.mappings.AggregateObjectMapping aggregateobjectmapping = new org.eclipse.persistence.mappings.AggregateObjectMapping();
aggregateobjectmapping.setAttributeName("version");
aggregateobjectmapping.setIsReadOnly(false);
aggregateobjectmapping.setReferenceClass(TimestampVersion.class);
aggregateobjectmapping.setIsNullAllowed(true);
descriptor.addMapping(aggregateobjectmapping);
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class LockInCache method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(LockInCache.class);
descriptor.setTableName("CACH_LCK");
descriptor.setPrimaryKeyFieldName("ID");
descriptor.setSequenceNumberName("SEQ");
descriptor.setSequenceNumberFieldName("ID");
descriptor.useVersionLocking("VERSION");
/* Next define the attribute mappings. */
descriptor.addDirectMapping("id", "ID");
descriptor.addDirectMapping("value", "A_VALUE");
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class TimestampInObject method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(TimestampInObject.class);
descriptor.setTableName("TSO_LCK");
descriptor.setPrimaryKeyFieldName("ID");
descriptor.setSequenceNumberName("SEQ");
descriptor.setSequenceNumberFieldName("ID");
descriptor.useTimestampLocking("VERSION", false);
/* Next define the attribute mappings. */
descriptor.addDirectMapping("id", "ID");
descriptor.addDirectMapping("value", "A_VALUE");
descriptor.addDirectMapping("version", "VERSION");
return descriptor;
}
Aggregations