use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class UUIDTester method descriptorWithAccessors.
public static RelationalDescriptor descriptorWithAccessors() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(UUIDTester.class);
descriptor.setTableName("UUIDS");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
try {
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("uuidValue", "getUuidValue", "setUuidValue", "UUIDV");
} catch (DescriptorException exception) {
}
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class UUIDTester method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(UUIDTester.class);
descriptor.setTableName("UUIDS");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("uuidValue", "UUIDV");
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class BidirectionWithHashtableTest method descriptor.
public RelationalDescriptor descriptor() {
RelationalDescriptor employeeDescriptor = new RelationalDescriptor();
employeeDescriptor.setJavaClass(Employee.class);
employeeDescriptor.setTableName("VAL_EMP");
employeeDescriptor.setPrimaryKeyFieldName("ID");
OneToManyMapping phoneNumbersMapping = new OneToManyMapping();
phoneNumbersMapping.setAttributeName("phoneNumbers");
phoneNumbersMapping.setReferenceClass(org.eclipse.persistence.testing.models.employee.domain.PhoneNumber.class);
phoneNumbersMapping.useTransparentCollection();
phoneNumbersMapping.useMapClass(org.eclipse.persistence.indirection.IndirectMap.class, "getNumber");
phoneNumbersMapping.privateOwnedRelationship();
phoneNumbersMapping.addTargetForeignKeyFieldName("PHONE.EMP_ID", "EMPLOYEE.EMP_ID");
phoneNumbersMapping.setRelationshipPartnerAttributeName("employee");
employeeDescriptor.addMapping(phoneNumbersMapping);
return employeeDescriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class ChildDoesNotDefineAbstractQueryKeyOfParentTest method buildProjectInterfaceDescriptor.
public RelationalDescriptor buildProjectInterfaceDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.setJavaClass(org.eclipse.persistence.testing.models.employee.interfaces.Project.class);
descriptor.descriptorIsForInterface();
// old
// descriptor.addDirectQueryKey("description", "DESCRIP");
// new
descriptor.addAbstractQueryKey("testKey");
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class ChildDoesNotDefineAbstractQueryKeyOfParentTest method buildTestDescriptor.
public RelationalDescriptor buildTestDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.setJavaClass(org.eclipse.persistence.testing.models.employee.domain.Project.class);
descriptor.addTableName("PROJECT");
descriptor.addPrimaryKeyFieldName("PROJECT.PROJ_ID");
descriptor.getInterfacePolicy().addParentInterface(org.eclipse.persistence.testing.models.employee.interfaces.Project.class);
return descriptor;
}
Aggregations