Package models

Examples of models.Entity2.save()


            Validation.clear();
            ParamNode rootParamNode = ParamNode.convert(params.all());
            entity2.edit(rootParamNode, "entity2");
            assertFalse(Validation.hasErrors());

            entity2.save();
            entity2.refresh();

            assertEquals("testNewEntity2", entity2.a);
            assertEquals(true, entity2.b);
            assertEquals(1, entity2.c);
View Full Code Here


            Validation.clear();
            ParamNode rootParamNode = ParamNode.convert(params.all());
            entity2.edit(rootParamNode, "entity2");
            assertFalse(Validation.hasErrors());

            entity2.save();

            assertEquals("testNewEntity2", entity2.a);
            assertEquals(true, entity2.b);
            assertEquals(1, entity2.c);
            assertEquals(city.getId(), entity2.city.id);
View Full Code Here

            city.name = "Name";
            city.save();

            entity2.city = city;
            entity2.cities = null;
            entity2.save();

            // edit gateway
            Params params = new Params();
            params.put("entity2.cities", city.getId().toString());
View Full Code Here

            entity2.edit(rootParamNode, "entity2");

            // Here we have a problem has the payment gateways can be modified
            assertFalse(Validation.hasErrors());

            entity2.save();
            entity2.refresh();

            assertEquals(0, entity2.cities.size());
        } finally {
            if (entity2 != null && entity2.id != null) {
View Full Code Here

            city.save();

            entity2.city = city;
            entity2.cities = new ArrayList<City>();
            entity2.cities.add(city);
            entity2.save();

            // edit gateway
            Params params = new Params();
            params.put("entity2.cities", (String) null);
View Full Code Here

            entity2.edit(rootParamNode, "entity2");

            // Here we have a problem has the payment gateways can be modified
            assertFalse(Validation.hasErrors());

            entity2.save();
            entity2.refresh();

            assertEquals(1, entity2.cities.size());
            assertEquals("Name", entity2.cities.get(0).name);
        } finally {
View Full Code Here

            city.save();

            entity2.city = city;
            entity2.cities = new ArrayList<City>();
            entity2.cities.add(city);
            entity2.save();

            // Try with id but set to empty
            Params params = new Params();
            params.put("entity2.cities.id", "");
View Full Code Here

            Validation.clear();
            ParamNode rootParamNode = ParamNode.convert(params.all());
            entity2.edit(rootParamNode, "entity2");
            assertFalse(Validation.hasErrors());

            entity2.save();
            entity2.refresh();

            assertEquals(0, entity2.cities.size());
        } finally {
            if (entity2 != null && entity2.id != null) {
View Full Code Here

            city.save();

            entity2.city = city;
            entity2.cities = new ArrayList<City>();
            entity2.cities.add(city);
            entity2.save();

            // Try with id but set to null
            Params params = new Params();
            params.put("entity2.cities.id", (String) null);
View Full Code Here

            Validation.clear();
            ParamNode rootParamNode = ParamNode.convert(params.all());
            entity2.edit(rootParamNode, "entity2");
            assertFalse(Validation.hasErrors());

            entity2.save();
            entity2.refresh();

            assertEquals(0, entity2.cities.size());
        } finally {
            if (entity2 != null && entity2.id != null) {
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.