It's hard for me to work with booleans in Siena 2.0.7 and Play 1.2.4.
In the constructor of my class, I set the boolean value to FALSE. Then I save the object. In the data warehouse viewer, I see that the logical field is saved as 0.
When I retrieve this row from the database, the logical field is parsed as TRUE. I'm lost, hope you can help!
Grade:
@Entity public class CMessage extends EnhancedModel { public CMessage() { this.isProcessed = false; } public CMessage(String bridgeId) { this.bridgeId = bridgeId;
Test:
CMessage msg = new models.CMessage("bridge"); Logger.info("saved isProcessed = %s", msg.isProcessed); // always gives false msg.save(); Logger.info("saved isProcessed = %s", msg.isProcessed); // always gives false CMessage get = (CMessage) CMessage.findAll().get(0); Logger.info("got isProcessed = %s", get.isProcessed); // always gives true assertEquals(false, get.isProcessed);
Note: I did not test GAE myself, only on my dev machine. Maybe gae datastore is doing everything right ...
source share