/** @param clazzDescriptor */
  protected void iconizeTableName(final ClassDescriptor clazzDescriptor, final Session session) {
    final String alias = clazzDescriptor.getAlias();

    final String tableName = NameUtils.camelCaseToUnderscore(alias);

    LogSupport.logFine(session, "Set Tablename to {0}", tableName);
    clazzDescriptor.setTableName(tableName);
  }
示例#2
0
  public static ClassDescriptor descriptor() {
    ClassDescriptor descriptor = new ClassDescriptor();

    descriptor.setJavaClass(Promoter.class);
    descriptor.setTableName("RO_PROMO");
    descriptor.addPrimaryKeyFieldName("PROMO_ID");
    descriptor.setSequenceNumberName("PROMO_SEQ");
    descriptor.setSequenceNumberFieldName("PROMO_ID");

    descriptor.addDirectMapping("id", "PROMO_ID");
    descriptor.addDirectMapping("name", "NAME");
    /*
    	// The promoter operates in a collection of countries.
    	org.eclipse.persistence.mappings.OneToManyMapping phoneNumbersMapping = new org.eclipse.persistence.mappings.OneToManyMapping() ;
    	phoneNumbersMapping.setAttributeName("phoneNumbers");
    	phoneNumbersMapping.setReferenceClass(PhoneNumber.class);
    	phoneNumbersMapping.setTargetForeignKeyFieldName("PROMO_ID");
    	phoneNumbersMapping.privateOwnedRelationship();
    //	phoneNumbersMapping.dontUseIndirection();
    	descriptor.addMapping(phoneNumbersMapping);
    */

    return descriptor;
  }