Package models

Examples of models.Entity2.save()


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

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

            // Try to bind with other field
            Validation.clear();
            Params params = new Params();
            params.put("entity2.cities.a", city.name);
View Full Code Here


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

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

            assertNotNull(entity2.cities);
            assertEquals(0, entity2.cities.size());
        } finally {
View Full Code Here

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

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

            // Try to bind with other field
            Validation.clear();
            Params params = new Params();
            params.put("entity2.cities.id.1", city.getId().toString());
View Full Code Here

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

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

            assertNotNull(entity2.cities);
            assertEquals(0, entity2.cities.size());
        } finally {
View Full Code Here

            city.save();

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

            Params params = new Params();

            Validation.clear();
            ParamNode rootParamNode = ParamNode.convert(params.all());
View Full Code Here

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

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

            assertEquals(1, entity2.cities.size());
            assertEquals(city.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();

            Params params = new Params();
            params.put("entity2", (String) null);

            Validation.clear();
View Full Code Here

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

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

            assertEquals(1, entity2.cities.size());
            assertEquals(city.name, entity2.cities.get(0).name);
        } finally {
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.