Search in sources :

Example 66 with RelationalDescriptor

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);
}
Also used : RelationalDescriptor(org.eclipse.persistence.descriptors.RelationalDescriptor)

Example 67 with RelationalDescriptor

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;
}
Also used : RelationalDescriptor(org.eclipse.persistence.descriptors.RelationalDescriptor)

Example 68 with RelationalDescriptor

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;
}
Also used : RelationalDescriptor(org.eclipse.persistence.descriptors.RelationalDescriptor)

Example 69 with RelationalDescriptor

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;
}
Also used : RelationalDescriptor(org.eclipse.persistence.descriptors.RelationalDescriptor)

Example 70 with RelationalDescriptor

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;
}
Also used : RelationalDescriptor(org.eclipse.persistence.descriptors.RelationalDescriptor)

Aggregations

RelationalDescriptor (org.eclipse.persistence.descriptors.RelationalDescriptor)306 DirectToFieldMapping (org.eclipse.persistence.mappings.DirectToFieldMapping)122 OneToOneMapping (org.eclipse.persistence.mappings.OneToOneMapping)43 EclipseLinkException (org.eclipse.persistence.exceptions.EclipseLinkException)26 DescriptorException (org.eclipse.persistence.exceptions.DescriptorException)19 OneToManyMapping (org.eclipse.persistence.mappings.OneToManyMapping)18 Vector (java.util.Vector)17 TransparentIndirectionPolicy (org.eclipse.persistence.internal.indirection.TransparentIndirectionPolicy)15 MappedKeyMapContainerPolicy (org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy)15 TransformationMapping (org.eclipse.persistence.mappings.TransformationMapping)13 IntegrityChecker (org.eclipse.persistence.exceptions.IntegrityChecker)12 ManyToManyMapping (org.eclipse.persistence.mappings.ManyToManyMapping)10 java.util (java.util)9 AggregateObjectMapping (org.eclipse.persistence.mappings.AggregateObjectMapping)8 org.eclipse.persistence.mappings (org.eclipse.persistence.mappings)7 UnidirectionalOneToManyMapping (org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping)6 ObjectTypeConverter (org.eclipse.persistence.mappings.converters.ObjectTypeConverter)6 DatabaseRecord (org.eclipse.persistence.sessions.DatabaseRecord)6 DirectCollectionMapping (org.eclipse.persistence.mappings.DirectCollectionMapping)5 DirectMapMapping (org.eclipse.persistence.mappings.DirectMapMapping)4