private int compareAsc(GenericEntity obj, GenericEntity obj2) { if (this.modelField == null) { this.modelField = obj.getModelEntity().getField(field); if (this.modelField == null) { throw new IllegalArgumentException("The field " + field + " could not be found in the entity " + obj.getEntityName()); } } Object value = obj.dangerousGetNoCheckButFast(this.modelField); Object value2 = obj2.dangerousGetNoCheckButFast(this.modelField); // null is defined as the largest possible value if (value == null) return value2 == null ? 0 : 1; if (value2 == null) return value == null ? 0 : -1; int result = ((Comparable) value).compareTo(value2); // if (Debug.infoOn()) Debug.logInfo("[OrderByComparator.compareAsc] Result is " + result + " for [" + value + "] and [" + value2 + "]"); return result; }
private int compareAsc(GenericEntity obj, GenericEntity obj2) { if (this.modelField == null) { this.modelField = obj.getModelEntity().getField(field); if (this.modelField == null) { throw new IllegalArgumentException("The field " + field + " could not be found in the entity " + obj.getEntityName()); } } Object value = obj.dangerousGetNoCheckButFast(this.modelField); Object value2 = obj2.dangerousGetNoCheckButFast(this.modelField); // null is defined as the largest possible value if (value == null) return value2 == null ? 0 : 1; if (value2 == null) return value == null ? 0 : -1; int result = ((Comparable) value).compareTo(value2); // if (Debug.infoOn()) Debug.logInfo("[OrderByComparator.compareAsc] Result is " + result + " for [" + value + "] and [" + value2 + "]"); return result; }
private int compareAsc(GenericEntity obj, GenericEntity obj2) { if (this.modelField == null) { this.modelField = obj.getModelEntity().getField(field); if (this.modelField == null) { throw new IllegalArgumentException("The field " + field + " could not be found in the entity " + obj.getEntityName()); } } Object value = obj.dangerousGetNoCheckButFast(this.modelField); Object value2 = obj2.dangerousGetNoCheckButFast(this.modelField); // null is defined as the largest possible value if (value == null) return value2 == null ? 0 : 1; if (value2 == null) return value == null ? 0 : -1; int result = ((Comparable) value).compareTo(value2); // if (Debug.infoOn()) Debug.logInfo("[OrderByComparator.compareAsc] Result is " + result + " for [" + value + "] and [" + value2 + "]"); return result; }
public static void setValue(SQLProcessor sqlP, ModelField modelField, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { Object fieldValue = entity.dangerousGetNoCheckButFast(modelField); setValue(sqlP, modelField, entity.getEntityName(), fieldValue, modelFieldTypeReader); }
public static void setValue(SQLProcessor sqlP, ModelField modelField, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { Object fieldValue = entity.dangerousGetNoCheckButFast(modelField); setValue(sqlP, modelField, entity.getEntityName(), fieldValue, modelFieldTypeReader); }
public static void setValue(SQLProcessor sqlP, ModelField modelField, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { Object fieldValue = entity.dangerousGetNoCheckButFast(modelField); setValue(sqlP, modelField, entity.getEntityName(), fieldValue, modelFieldTypeReader); }
/** * Get all primary keys from the model entity and bind their values * to the an SQL statement (SQL-Processor) * * @param sqlP * @param list * @param entity * @throws GenericEntityException */ public static void setPkValues(SQLProcessor sqlP, ModelEntity modelEntity, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { for (int j = 0; j < modelEntity.getPksSize(); j++) { ModelField curField = modelEntity.getPk(j); // for where clause variables only setValue if not null... if (entity.dangerousGetNoCheckButFast(curField) != null) { setValue(sqlP, curField, entity, modelFieldTypeReader); } } }
/** * Get all primary keys from the model entity and bind their values * to the an SQL statement (SQL-Processor) * * @param sqlP * @param modelEntity * @param entity * @param modelFieldTypeReader * @throws GenericEntityException */ public static void setPkValues(SQLProcessor sqlP, ModelEntity modelEntity, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { for (int j = 0; j < modelEntity.getPksSize(); j++) { ModelField curField = modelEntity.getPk(j); // for where clause variables only setValue if not null... if (entity.dangerousGetNoCheckButFast(curField) != null) { setValue(sqlP, curField, entity, modelFieldTypeReader); } } }
/** * Get all primary keys from the model entity and bind their values * to the an SQL statement (SQL-Processor) * * @param sqlP * @param list * @param entity * @throws GenericEntityException */ public static void setPkValues(SQLProcessor sqlP, ModelEntity modelEntity, GenericEntity entity, ModelFieldTypeReader modelFieldTypeReader) throws GenericEntityException { for (int j = 0; j < modelEntity.getPksSize(); j++) { ModelField curField = modelEntity.getPk(j); // for where clause variables only setValue if not null... if (entity.dangerousGetNoCheckButFast(curField) != null) { setValue(sqlP, curField, entity, modelFieldTypeReader); } } }
throw new IllegalArgumentException("\"" + thruDateName + "\" is not a field of " + datedValue.getEntityName()); java.sql.Timestamp fromDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(fromDateField); java.sql.Timestamp thruDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(thruDateField); java.sql.Timestamp fromDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(fromDateField); java.sql.Timestamp thruDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(thruDateField);