use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class ConcurrentLargeProject method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(ConcurrentLargeProject.class);
descriptor.setTableName("CONCURRENT_PROJECT");
// Inheritance Properties.
descriptor.getInheritancePolicy().setParentClass(ConcurrentProject.class);
OneToOneMapping supervisorMapping = new OneToOneMapping();
supervisorMapping.setAttributeName("supervisor");
supervisorMapping.setReferenceClass(ConcurrentPerson.class);
supervisorMapping.setGetMethodName("getSupervisor");
supervisorMapping.setSetMethodName("setSupervisor");
supervisorMapping.dontUseIndirection();
supervisorMapping.addTargetForeignKeyFieldName("CONCURRENT_EMP.PROJ_ID", "CONCURRENT_PROJECT.ID");
descriptor.addMapping(supervisorMapping);
OneToOneMapping locationMapping = new OneToOneMapping();
locationMapping.setAttributeName("location");
locationMapping.setReferenceClass(ConcurrentAddress.class);
locationMapping.setGetMethodName("getLocation");
locationMapping.setSetMethodName("setLocation");
locationMapping.dontUseIndirection();
locationMapping.addForeignKeyFieldName("CONCURRENT_PROJECT.LOCATION_ID", "CONCURRENT_ADDRESS.ADDRESS_ID");
descriptor.addMapping(locationMapping);
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class BooleanTester method descriptorWithAccessors.
public static RelationalDescriptor descriptorWithAccessors() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(BooleanTester.class);
descriptor.setTableName("BOOLEANS");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
try {
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("booleanValue", "getBooleanValue", "setBooleanValue", "BOOLEANV");
descriptor.addDirectMapping("booleanClassValue", "getBooleanClassValue", "setBooleanClassValue", "BOOLEANC");
} catch (DescriptorException exception) {
}
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class CLOBTester method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(CLOBTester.class);
descriptor.setTableName("CLOBS");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("longString", "THECLOB");
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class TimeDateTester method descriptorWithAccessors.
public static RelationalDescriptor descriptorWithAccessors() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(TimeDateTester.class);
descriptor.setTableName("TIMEDATE");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("utilDate", "getUtilDate", "setUtilDate", "UTILDATE");
descriptor.addDirectMapping("sqlDate", "getSQLDate", "setSQLDate", "SQLDATE");
descriptor.addDirectMapping("time", "getTime", "setTime", "TTIME");
descriptor.addDirectMapping("timestamp", "getTimestamp", "setTimestamp", "TSTAMP");
return descriptor;
}
use of org.eclipse.persistence.descriptors.RelationalDescriptor in project eclipselink by eclipse-ee4j.
the class TimeDateTester method descriptor.
public static RelationalDescriptor descriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
/* First define the class, table and descriptor properties. */
descriptor.setJavaClass(TimeDateTester.class);
descriptor.setTableName("TIMEDATE");
descriptor.setPrimaryKeyFieldName("NAME");
/* Next define the attribute mappings. */
descriptor.addDirectMapping("testName", "getTestName", "setTestName", "NAME");
descriptor.addDirectMapping("utilDate", "UTILDATE");
descriptor.addDirectMapping("sqlDate", "SQLDATE");
descriptor.addDirectMapping("time", "TTIME");
descriptor.addDirectMapping("timestamp", "TSTAMP");
return descriptor;
}
Aggregations