MentaBean

Compare Revisions

Ignore whitespace Rev 186 → Rev 187

/trunk/src/test/java/org/mentabean/jdbc/AnotherProxyTest.java
140,6 → 140,8
//let's play...
Customer c1 = new Customer("Erico", true, new BigDecimal("3.5"));
c1.setAge(22);
c1.setType(Type.A);
c1.setTypeTwo(TypeTwo.B);
Customer c2 = new Customer("Jessica", true, new BigDecimal("692.894"));
Customer c3 = new Customer("Inactive customer", false, null);
session.insert(c1);
152,8 → 154,11
session.loadMinus(cDB, pxy.getActive());
session.loadList(new Customer(), pxy.getName(), pxy.getActive());
c1 = new Customer(c1.getCode());
session.load(c1);
assertEquals(22, c1.getAge());
assertEquals(Type.A, c1.getType());
assertEquals(TypeTwo.B, c1.getTypeTwo());
Customer upd = new Customer(c1.getCode());
upd.setName("Erico KL");
/trunk/src/main/java/org/mentabean/type/EnumValueType.java
115,7 → 115,8
 
stmt.setString(index, null);
 
} else if (value.getClass().isAssignableFrom(enumType)) {
//Support for overwritten enums (superclass on left)
} else if (enumType.isAssignableFrom(value.getClass())) {
 
final String s = value.name();
 
123,7 → 124,7
 
} else {
 
throw new IllegalArgumentException("Value is not an enum!");
throw new IllegalArgumentException("Value '"+value+"' from '"+value.getClass()+"' is not an enum!");
}
 
}
/trunk/src/main/java/org/mentabean/type/EnumIdType.java
137,7 → 137,8
 
stmt.setNull(index, Types.INTEGER);
 
} else if (value.getClass().isAssignableFrom(enumType)) {
//Support for overwritten enums (superclass on left)
} else if (enumType.isAssignableFrom(value.getClass())) {
 
final int id = getId(value);
 
145,7 → 146,7
 
} else {
 
throw new IllegalArgumentException("Value is not an enum!");
throw new IllegalArgumentException("Value '"+value+"' from '"+value.getClass()+"' is not an enum!");
}
}