Search in sources :

Example 21 with PersonLongAutoID

use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.

the class BaseTestNoAutoInc_DEFAULT method testOrderLongAutoId.

public void testOrderLongAutoId() {
    List<PersonLongAutoID> people = queryPersonLongAutoIDOrderBy("id", "", false).fetch();
    assertNotNull(people);
    assertEquals(3, people.size());
    PersonLongAutoID[] array = new PersonLongAutoID[] { LongAutoID_TESLA, LongAutoID_CURIE, LongAutoID_EINSTEIN };
    int i = 0;
    for (PersonLongAutoID person : people) {
        assertEquals(array[i], person);
        i++;
    }
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 22 with PersonLongAutoID

use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.

the class BaseTest method getPersonLongAutoID.

private PersonLongAutoID getPersonLongAutoID(Long id) {
    PersonLongAutoID p = new PersonLongAutoID();
    p.id = id;
    pm.get(p);
    return p;
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 23 with PersonLongAutoID

use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.

the class BaseTest method testRestoreQueryOption.

public void testRestoreQueryOption() {
    QueryOption optRestored = (QueryOption) JsonSerializer.deserialize(QueryOption.class, Json.loads("{\"type\":\"" + QueryOptionPage.class.getName() + "\", \"value\": {\"pageType\": \"TEMPORARY\", \"state\": \"PASSIVE\", \"pageSize\": 0, \"type\": 1} }"));
    Query<PersonLongAutoID> query = pm.createQuery(PersonLongAutoID.class);
    QueryOption opt = query.option(QueryOptionPage.ID);
    assertEquals(opt, optRestored);
}
Also used : QueryOptionPage(siena.core.options.QueryOptionPage) QueryOption(siena.core.options.QueryOption) PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 24 with PersonLongAutoID

use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.

the class BaseTest method testGetLongAutoID.

public void testGetLongAutoID() {
    PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
    assertEquals(LongAutoID_CURIE, curie);
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 25 with PersonLongAutoID

use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.

the class BaseTest method testDumpQueryOption.

public void testDumpQueryOption() {
    Query<PersonLongAutoID> query = pm.createQuery(PersonLongAutoID.class);
    QueryOption opt = query.option(QueryOptionPage.ID);
    Json dump = opt.dump();
    String str = JsonSerializer.serialize(dump).toString();
    assertNotNull(str);
    assertEquals("{\"value\": {\"pageType\": \"TEMPORARY\", \"state\": \"PASSIVE\", \"pageSize\": 0, \"type\": 1}, \"type\": \"" + QueryOptionPage.class.getName() + "\"}", str);
}
Also used : QueryOptionPage(siena.core.options.QueryOptionPage) QueryOption(siena.core.options.QueryOption) PersonLongAutoID(siena.base.test.model.PersonLongAutoID) Json(siena.Json)

Aggregations

PersonLongAutoID (siena.base.test.model.PersonLongAutoID)47 SienaRestrictedApiException (siena.SienaRestrictedApiException)11 ArrayList (java.util.ArrayList)3 List (java.util.List)3 QueryFilter (siena.QueryFilter)2 QueryOption (siena.core.options.QueryOption)2 QueryOptionPage (siena.core.options.QueryOptionPage)2 Json (siena.Json)1 QueryFilterSearch (siena.QueryFilterSearch)1 QueryFilterSimple (siena.QueryFilterSimple)1 QueryOrder (siena.QueryOrder)1