mandubian/siena — Issue #16: Cannot retrieve record containing an embedded java.util.Date
Author: atomicleopard
Created: 2012-02-01 01:46:17+00:00
State: open

Using Play 1.2.4
siena 2.0.7
crudsiena 2.0.2
gae 1.6.0

Given:

```java
@EmbeddedMap
public class PaymentTransaction {
@DecimalPrecision(storageType = StorageType.STRING, size = 19, scale = 2)
public BigDecimal amountOwing = BigDecimal.ZERO;
@DecimalPrecision(storageType = StorageType.STRING, size = 19, scale = 2)
public BigDecimal amountPaid = BigDecimal.ZERO;
public String token;
public String receipt;
public Date created;
public Date closed;
}
```
reference like this:

```java
@Embedded
public List transactions = new ArrayList();
```
On a getByKey request I get the error:

```java
Caused by: siena.SienaException: expected: '{', '[', '"', true, false, null, or a number at 14
at siena.Parser.next(Json.java:705)
at siena.Parser.next(Json.java:665)
at siena.Parser.next(Json.java:638)
at siena.Parser.parse(Json.java:574)
at siena.Json.loads(Json.java:547)
at siena.Util.fromObject(Util.java:249)
at siena.Util.setFromObject(Util.java:294)
at siena.gae.GaeMappingUtils.setFromObject(GaeMappingUtils.java:612)
at siena.gae.GaeMappingUtils.fillModel(GaeMappingUtils.java:515)
```

I've tried a few variations on the Dates, including:

```java
@DateTime
public Date closed;

@DateTime
@As(lang = { "*" }, value = { "yyyy-MM-dd hh:mm:ss" })
public Date closed;
```