Search code examples
playorm

@NoSqlEmbedded not working


I have two class on my project that follows:

@NoSqlEmbeddable
public class RequestTO2 {
 @NoSqlId
private String id;
private String jSon
getter(), setters() }

@NoSqlEntity
public class User {
@NoSqlId
 @NoSqlIndexed
private String id;
@NoSqlEmbedded
private List<RequestTO2> requests = new ArrayList<RequestTO2>();
getters(), setters() }

In my code I'm trying to do an User insert with request :

User user = new User();
user.setId( "111" );
RequestTO2 req2 = new RequestTO2 ();
req2.setId("abc");
req2.setjSon("json:test");
user.getRequests().add(req2);
em.put( user );
em.flush( user );

The User is saved, no erros appears, but informations about request has not be been saved with User data ... (nothing is inserted for request )

any idea for what am I doing wrong ?

Thanks,

Andre


Solution

  • You are not doing anything wrong...you caught us with our pants down. We are literally in the middle of that one. Last week, we just delivered support for this code which does work...

    public class Car {
       @NoSqlEmbedded
       private List<String> cookies;
       @NoSqlEmbedded
       private List<LocalDate> dates;
    }
    

    but we have not completed the above one. It is currently half done which is sadly why you get no errors(previously, the error was "this is not supported yet")

    thanks, Dean