@Test public void testEquals() throws Exception { Field field1 = DefaultTypes.class.getDeclaredField("booleanField"); FieldType fieldType1 = FieldType.createFieldType(connectionSource, DefaultTypes.class.getSimpleName(), field1, DefaultTypes.class); FieldType fieldType2 = FieldType.createFieldType(connectionSource, DefaultTypes.class.getSimpleName(), field1, DefaultTypes.class); Field field2 = DefaultTypes.class.getDeclaredField("byteField"); FieldType fieldType3 = FieldType.createFieldType(connectionSource, DefaultTypes.class.getSimpleName(), field2, DefaultTypes.class); FieldType fieldType4 = FieldType.createFieldType(connectionSource, DefaultTypes.class.getSimpleName(), field2, DefaultTypes.class); assertTrue(fieldType1.equals(fieldType1)); assertTrue(fieldType2.equals(fieldType2)); assertTrue(fieldType1.equals(fieldType2)); assertTrue(fieldType2.equals(fieldType1)); assertEquals(fieldType1.hashCode(), fieldType2.hashCode()); assertFalse(fieldType1.equals(null)); assertFalse(fieldType1.equals(fieldType3)); assertFalse(fieldType1.equals(fieldType4)); assertFalse(fieldType3.equals(fieldType1)); assertFalse(fieldType4.equals(fieldType1)); assertTrue(fieldType3.equals(fieldType3)); assertTrue(fieldType4.equals(fieldType4)); assertTrue(fieldType3.equals(fieldType4)); assertTrue(fieldType4.equals(fieldType3)); assertEquals(fieldType3.hashCode(), fieldType4.hashCode()); }
@Override public boolean equals(Object arg) { if (arg == null || arg.getClass() != this.getClass()) { return false; } FieldType other = (FieldType) arg; return field.equals(other.field) && (parentClass == null ? other.parentClass == null : parentClass.equals(other.parentClass)); }
FieldType { @Override public boolean equals(Object arg) { if (arg == null || arg.getClass() != this.getClass()) { return false; } FieldType other = (FieldType) arg; return field.equals(other.field) && (parentClass == null ? other.parentClass == null : parentClass.equals(other.parentClass)); } }
FieldType { @Override public boolean equals(Object arg) { if (arg == null || arg.getClass() != this.getClass()) { return false; } FieldType other = (FieldType) arg; return field.equals(other.field) && (parentClass == null ? other.parentClass == null : parentClass.equals(other.parentClass)); } FieldType(ConnectionSource connectionSource, String tableName, Field field, DatabaseFieldConfig fieldConfig,
			Class<?> parentClass); }
FieldType { @Override public boolean equals(Object arg) { if (arg == null || arg.getClass() != this.getClass()) { return false; } FieldType other = (FieldType) arg; return field.equals(other.field) && (parentClass == null ? other.parentClass == null : parentClass.equals(other.parentClass)); } FieldType(ConnectionSource connectionSource, String tableName, Field field, DatabaseFieldConfig fieldConfig,
			Class<?> parentClass); void configDaoInformation(ConnectionSource connectionSource, Class<?> parentClass); Field getField(); String getTableName(); String getFieldName(); Class<?> getType(); Type getGenericType(); String getColumnName(); DataPersister getDataPersister(); Object getDataTypeConfigObj(); SqlType getSqlType(); Object getDefaultValue(); int getWidth(); boolean isCanBeNull(); boolean isId(); boolean isGeneratedId(); boolean isGeneratedIdSequence(); String getGeneratedIdSequence(); boolean isForeign(); void assignField(Object data, Object val, boolean parentObject, ObjectCache objectCache); Object assignIdValue(Object data, Number val, ObjectCache objectCache); FV extractRawJavaFieldValue(Object object); Object extractJavaFieldValue(Object object); Object extractJavaFieldToSqlArgValue(Object object); Object convertJavaFieldToSqlArgValue(Object fieldVal); Object convertStringToJavaField(String value, int columnPos); Object moveToNextValue(Object val); FieldType getForeignIdField(); FieldType getForeignRefField(); boolean isEscapedValue(); Enum<?> getUnknownEnumVal(); String getFormat(); boolean isUnique(); boolean isUniqueCombo(); String getIndexName(); String getUniqueIndexName(); boolean isEscapedDefaultValue(); boolean isComparable(); boolean isArgumentHolderRequired(); boolean isForeignCollection(); BaseForeignCollection<FT, FID> buildForeignCollection(Object parent, FID id); T resultToJava(DatabaseResults results, Map<String, Integer> columnPositions); boolean isSelfGeneratedId(); boolean isAllowGeneratedIdInsert(); String getColumnDefinition(); boolean isForeignAutoCreate(); boolean isVersion(); Object generateId(); boolean isReadOnly(); FV getFieldValueIfNotDefault(Object object); boolean isObjectsFieldValueDefault(Object object); Object getJavaDefaultValueDefault(); int createWithForeignDao(T foreignData); static FieldType createFieldType(ConnectionSource connectionSource, String tableName, Field field,
			Class<?> parentClass); @Override boolean equals(Object arg); @Override int hashCode(); @Override String toString(); }
FieldType { @Override public boolean equals(Object arg) { if (arg == null || arg.getClass() != this.getClass()) { return false; } FieldType other = (FieldType) arg; return field.equals(other.field) && (parentClass == null ? other.parentClass == null : parentClass.equals(other.parentClass)); } FieldType(ConnectionSource connectionSource, String tableName, Field field, DatabaseFieldConfig fieldConfig,
			Class<?> parentClass); void configDaoInformation(ConnectionSource connectionSource, Class<?> parentClass); Field getField(); String getTableName(); String getFieldName(); Class<?> getType(); Type getGenericType(); String getColumnName(); DataPersister getDataPersister(); Object getDataTypeConfigObj(); SqlType getSqlType(); Object getDefaultValue(); int getWidth(); boolean isCanBeNull(); boolean isId(); boolean isGeneratedId(); boolean isGeneratedIdSequence(); String getGeneratedIdSequence(); boolean isForeign(); void assignField(Object data, Object val, boolean parentObject, ObjectCache objectCache); Object assignIdValue(Object data, Number val, ObjectCache objectCache); FV extractRawJavaFieldValue(Object object); Object extractJavaFieldValue(Object object); Object extractJavaFieldToSqlArgValue(Object object); Object convertJavaFieldToSqlArgValue(Object fieldVal); Object convertStringToJavaField(String value, int columnPos); Object moveToNextValue(Object val); FieldType getForeignIdField(); FieldType getForeignRefField(); boolean isEscapedValue(); Enum<?> getUnknownEnumVal(); String getFormat(); boolean isUnique(); boolean isUniqueCombo(); String getIndexName(); String getUniqueIndexName(); boolean isEscapedDefaultValue(); boolean isComparable(); boolean isArgumentHolderRequired(); boolean isForeignCollection(); BaseForeignCollection<FT, FID> buildForeignCollection(Object parent, FID id); T resultToJava(DatabaseResults results, Map<String, Integer> columnPositions); boolean isSelfGeneratedId(); boolean isAllowGeneratedIdInsert(); String getColumnDefinition(); boolean isForeignAutoCreate(); boolean isVersion(); Object generateId(); boolean isReadOnly(); FV getFieldValueIfNotDefault(Object object); boolean isObjectsFieldValueDefault(Object object); Object getJavaDefaultValueDefault(); int createWithForeignDao(T foreignData); static FieldType createFieldType(ConnectionSource connectionSource, String tableName, Field field,
			Class<?> parentClass); @Override boolean equals(Object arg); @Override int hashCode(); @Override String toString(); static final String FOREIGN_ID_FIELD_SUFFIX; }