throw new IciqlException(e);\r
}\r
}\r
+ \r
+ @Override\r
+ public int hashCode() {\r
+ return columnName.hashCode();\r
+ }\r
+ \r
+ @Override\r
+ public boolean equals(Object o) {\r
+ if (o instanceof FieldDefinition) {\r
+ return o.hashCode() == hashCode();\r
+ }\r
+ return false;\r
+ }\r
}\r
\r
public ArrayList<FieldDefinition> fields = Utils.newArrayList();\r
classFields.addAll(Arrays.asList(superClass.getDeclaredFields()));\r
}\r
\r
+ Set<FieldDefinition> uniqueFields = new LinkedHashSet<FieldDefinition>();\r
T defaultObject = Db.instance(clazz);\r
for (Field f : classFields) {\r
// check if we should skip this field\r
fieldDef.defaultValue = defaultValue;\r
fieldDef.enumType = enumType;\r
fieldDef.dataType = ModelUtils.getDataType(fieldDef);\r
- fields.add(fieldDef);\r
+ uniqueFields.add(fieldDef);\r
}\r
}\r
+ fields.addAll(uniqueFields);\r
+ \r
List<String> primaryKey = Utils.newArrayList();\r
int primitiveBoolean = 0;\r
for (FieldDefinition fieldDef : fields) {\r