Revision: 9bcb160b53b2
Branch: default
Author: lucio.benfante <
lucio.b...@gmail.com>
Date: Wed Sep 4 13:18:39 2013 UTC
Log: Fixed ClassCastException in loading fixtures (TODO: no treatment
for classes not deriving from EntityBase)
http://code.google.com/p/lambico/source/detail?r=9bcb160b53b2
Modified:
/lambico-test/src/main/java/org/lambico/test/spring/hibernate/junit4/FixturesTestExecutionListener.java
=======================================
---
/lambico-test/src/main/java/org/lambico/test/spring/hibernate/junit4/FixturesTestExecutionListener.java
Fri Mar 8 16:54:08 2013 UTC
+++
/lambico-test/src/main/java/org/lambico/test/spring/hibernate/junit4/FixturesTestExecutionListener.java
Wed Sep 4 13:18:39 2013 UTC
@@ -99,7 +99,11 @@
for (Object entity : data) {
if (LoadMode.CLASS.equals(loadMode)) {
// transaction will be rollbacked, but session cache
lives
- ((Entity) entity).setId(null);
+ if (entity instanceof Entity) {
+ ((Entity) entity).setId(null);
+ } else {
+ // TODO: find an alternative for entities that
don't have Entity as base class!
+ }
}
template.save(entity);
}