Ebean.save(b3);
}
public void testAsId() {
EBasicEnumId b = new EBasicEnumId();
b.setName("Banana");
b.setStatus(EBasicEnumId.Status.NEW);
Ebean.save(b);
SqlQuery q = Ebean.createSqlQuery("select * from e_basic_enum_id where status = :status");
q.setParameter("status", b.getStatus());
SqlRow sqlRow = q.findUnique();
String strStatus = sqlRow.getString("status");
Assert.assertEquals("N", strStatus);
try {
b = Ebean.find(EBasicEnumId.class, b.getStatus());
} catch (java.lang.IllegalArgumentException iae) {
Assert.fail("The use of an enum as id should work : " + iae.getLocalizedMessage());
}
Assert.assertEquals(EBasicEnumId.Status.NEW, b.getStatus());
}