public RelationalDescriptor descriptor() { RelationalDescriptor descriptor = new RelationalDescriptor(); descriptor.setJavaClass(org.eclipse.persistence.testing.models.employee.domain.Employee.class); descriptor.addTableName("EMPLOYEE"); descriptor.addPrimaryKeyFieldName("EMPLOYEE.EMP_ID"); // Descriptor properties. descriptor.useFullIdentityMap(); descriptor.setIdentityMapSize(100); descriptor.useRemoteFullIdentityMap(); descriptor.setRemoteIdentityMapSize(100); descriptor.setSequenceNumberFieldName("EMP_ID"); descriptor.setSequenceNumberName("EMP_SEQ"); // the following causes the correct error to occure. descriptor.setExistenceChecking("Check Bash"); DirectToFieldMapping idMapping = new DirectToFieldMapping(); idMapping.setAttributeName("id"); idMapping.setFieldName("EMPLOYEE.EMP_ID"); descriptor.addMapping(idMapping); return descriptor; }
public RelationalDescriptor buildProjectDescriptor() { RelationalDescriptor descriptor = new RelationalDescriptor(); descriptor.setJavaClass(org.eclipse.persistence.testing.models.employee.domain.Project.class); descriptor.addTableName("PROJECT"); descriptor.addPrimaryKeyFieldName("PROJECT.PROJ_ID"); // Inheritance properties. descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE"); descriptor .getInheritancePolicy() .addClassIndicator( org.eclipse.persistence.testing.models.employee.domain.LargeProject.class, "L"); descriptor .getInheritancePolicy() .addClassIndicator( org.eclipse.persistence.testing.models.employee.domain.SmallProject.class, "S"); // Interface properties. // the following causes the correct error to occure. descriptor .getInterfacePolicy() .addParentInterface( org.eclipse.persistence.testing.models.employee.interfaces.LargeProject.class); // Descriptor properties. descriptor.useFullIdentityMap(); descriptor.setIdentityMapSize(100); descriptor.useRemoteFullIdentityMap(); descriptor.setRemoteIdentityMapSize(100); descriptor.setSequenceNumberFieldName("PROJ_ID"); descriptor.setSequenceNumberName("PROJ_SEQ"); // Query manager. descriptor.getQueryManager().checkCacheForDoesExist(); // Event manager. // Mappings. DirectToFieldMapping descriptionMapping = new DirectToFieldMapping(); descriptionMapping.setAttributeName("description"); descriptionMapping.setFieldName("PROJECT.DESCRIP"); descriptionMapping.setNullValue(""); descriptor.addMapping(descriptionMapping); DirectToFieldMapping idMapping = new DirectToFieldMapping(); idMapping.setAttributeName("id"); idMapping.setFieldName("PROJECT.PROJ_ID"); descriptor.addMapping(idMapping); /* DirectToFieldMapping nameMapping = new DirectToFieldMapping(); nameMapping.setAttributeName("name"); nameMapping.setFieldName("PROJECT.PROJ_NAME"); nameMapping.setNullValue(""); descriptor.addMapping(nameMapping); */ /* OneToOneMapping teamLeaderMapping = new OneToOneMapping(); teamLeaderMapping.setAttributeName("teamLeader"); teamLeaderMapping.setReferenceClass(org.eclipse.persistence.testing.models.employee.domain.Employee.class); teamLeaderMapping.useBasicIndirection(); teamLeaderMapping.addForeignKeyFieldName("PROJECT.LEADER_ID", "EMPLOYEE.EMP_ID"); descriptor.addMapping(teamLeaderMapping); */ return descriptor; }