Examples of Bbb


Examples of org.slim3.datastore.model.Bbb

        Hoge model2 = meta.entityToModel(entity2);
        bbb.getHogeRef().setModel(model2);
        Entity bbbEntity = bbbMeta.modelToEntity(bbb);
        Key bbbKey = ds.put(bbbEntity);
        Entity bbbEntity2 = ds.get(bbbKey);
        Bbb bbb2 = bbbMeta.entityToModel(bbbEntity2);
        assertThat(bbb2.getHogeRef().getKey(), is(key));
    }
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     */
    @Test
    public void convertValueForDatastoreForModelRef() throws Exception {
        BbbMeta bbbMeta = BbbMeta.get();
        MyCriterion criterion = new MyCriterion(bbbMeta.hogeRef);
        Bbb bbb = new Bbb();
        Key key = Datastore.createKey("Hoge", 1);
        bbb.getHogeRef().setKey(key);
        assertThat(
            (Key) criterion.convertValueForDatastore(bbb.getHogeRef()),
            is(key));
    }
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void nextForPolyModel() throws Exception {
        DatastoreUtil.put(ds, null, aaaMeta.modelToEntity(new Aaa()));
        DatastoreUtil.put(ds, null, bbbMeta.modelToEntity(new Bbb()));

        EntityQuery query = new EntityQuery(ds, "Aaa");
        Iterator<Entity> entityIterator = query.asIterator();
        ModelIterator<Aaa> modelIterator =
            new ModelIterator<Aaa>(entityIterator, aaaMeta);
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void asListForPolyModel() throws Exception {
        DatastoreUtil.put(ds, null, AaaMeta.get().modelToEntity(new Aaa()));
        DatastoreUtil.put(ds, null, BbbMeta.get().modelToEntity(new Bbb()));
        DatastoreUtil.put(ds, null, CccMeta.get().modelToEntity(new Ccc()));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        List<Aaa> list = query.asList();
        assertThat(list.size(), is(3));
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void asKeyListForPolyModel() throws Exception {
        DatastoreUtil.put(ds, null, AaaMeta.get().modelToEntity(new Aaa()));
        DatastoreUtil.put(ds, null, BbbMeta.get().modelToEntity(new Bbb()));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        List<Key> list = query.asKeyList();
        assertThat(list.size(), is(2));

View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void asIteratorForPolyModel() throws Exception {
        DatastoreUtil.put(ds, null, AaaMeta.get().modelToEntity(new Aaa()));
        DatastoreUtil.put(ds, null, BbbMeta.get().modelToEntity(new Bbb()));
        DatastoreUtil.put(ds, null, CccMeta.get().modelToEntity(new Ccc()));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        Iterator<Aaa> iterator = query.asIterator();
        assertThat(
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     */
    @Test
    public void minForPolyModel() throws Exception {
        Aaa aaa = new Aaa();
        aaa.setVersion(1L);
        Bbb bbb = new Bbb();
        bbb.setVersion(2L);
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, aaa));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, bbb));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        assertThat(query.min(aaaMeta.version), is(2L));
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     */
    @Test
    public void maxForPolyModel() throws Exception {
        Aaa aaa = new Aaa();
        aaa.setVersion(2L);
        Bbb bbb = new Bbb();
        bbb.setVersion(1L);
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, aaa));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, bbb));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        assertThat(query.max(aaaMeta.version), is(3L));
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void countForPolyModel() throws Exception {
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, new Aaa()));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, new Bbb()));

        ModelQuery<Aaa> query = new ModelQuery<Aaa>(ds, aaaMeta);
        assertThat(query.count(), is(2));

        ModelQuery<Bbb> query2 = new ModelQuery<Bbb>(ds, bbbMeta);
View Full Code Here

Examples of org.slim3.datastore.model.Bbb

     * @throws Exception
     */
    @Test
    public void getModel() throws Exception {
        Datastore.put(hoge);
        Bbb bbb = new Bbb();
        bbb.getHogeRef().setModel(hoge);
        Datastore.put(bbb);
        Bbb model = ref.getModel();
        assertThat(bbb, is(notNullValue()));
        assertThat(ref.getModel(), is(sameInstance(model)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.