Package demoapp.domain

Examples of demoapp.domain.Classification


        entityManager.getTransaction().begin();
        Locale en = new Locale("en", "English");
        managerImpl.dao.create(en);
        Locale es = new Locale("es", "Spanish");
        managerImpl.dao.create(es);
        Classification c = new Classification();
        c.setColor(new Color());
        c.getColor().setRed(100);c.getColor().setGreen(100);c.getColor().setBlue(20);
        c.setLetter("A");
        c.setNumber(1);
        c.setName(new I18nText());
        c.getName().setKey("key.1");
        c.getName().setValues(new ArrayList<LocalizedValue>(2));
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(0).setLocale(en);
        c.getName().getValues().get(0).setLocalizedValue("one");
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(1).setLocale(es);
        c.getName().getValues().get(1).setLocalizedValue("uno");
        managerImpl.dao.create(c);
        Classification c2 = new Classification();
        c2.setColor(new Color());
        c2.getColor().setRed(20);c2.getColor().setGreen(100);c2.getColor().setBlue(100);
        c2.setLetter("B");
        c2.setNumber(2);
        c2.setName(new I18nText());
        c2.getName().setKey("key.2");
        c2.getName().setValues(new ArrayList<LocalizedValue>(2));
        c2.getName().getValues().add(new LocalizedValue());
        c2.getName().getValues().get(0).setLocale(en);
        c2.getName().getValues().get(0).setLocalizedValue("two");
        c2.getName().getValues().add(new LocalizedValue());
        c2.getName().getValues().get(1).setLocale(es);
        c2.getName().getValues().get(1).setLocalizedValue("dos");
        managerImpl.dao.create(c2);
        entityManager.getTransaction().commit();
        entityManager.close();
    }
View Full Code Here

TOP

Related Classes of demoapp.domain.Classification

Copyright © 2018 www.massapicom. 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.