Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI.createEntityManager()


        OpenJPAEntityManagerFactorySPI emf =
            createEMF(ResWordEntity.class,
            "openjpa.jdbc.SchemaFactory","native(ForeignKeys=true)",
            "openjpa.jdbc.SynchronizeMappings","buildSchema(ForeignKeys=true)");

        EntityManager em = emf.createEntityManager();
        ResWordEntity pe = new ResWordEntity();

        pe.setId(new Random().nextInt());
        pe.setAlias("AliasVal");
View Full Code Here


    public void testMultipleSchemafactories3() {
        OpenJPAEntityManagerFactorySPI emf =
            createEMF(ResWordEntity.class,
            "openjpa.jdbc.SynchronizeMappings","buildSchema(ForeignKeys=true)");

        EntityManager em = emf.createEntityManager();
        ResWordEntity pe = new ResWordEntity();

        pe.setId(new Random().nextInt());
        pe.setAlias("AliasVal");
View Full Code Here

    public void testMultipleSchemafactories4() {
        OpenJPAEntityManagerFactorySPI emf =
            createEMF(ResWordEntity.class,
            "openjpa.jdbc.SchemaFactory","native(ForeignKeys=true)");

        EntityManager em = emf.createEntityManager();
        ResWordEntity pe = new ResWordEntity();

        pe.setId(new Random().nextInt());
        pe.setAlias("AliasVal");
View Full Code Here

        OpenJPAPersistence.createEntityManagerFactory(
                "no-pre-persist-default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);

        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
        try {
            DefGrpEntity dge = new DefGrpEntity();
            dge.setDgName(null)// If default group enabled for pre-persist, this would cause a CVE.
            try {
View Full Code Here

        OpenJPAPersistence.createEntityManagerFactory(
                "no-pre-update-default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);

        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
        try {
            DefGrpEntity dge = new DefGrpEntity();
            dge.setDgName(null);
            try {
View Full Code Here

                "multi-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml",
                propMap);
        assertNotNull(emf);
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);

        try {
            MixedGrpEntity mge = new MixedGrpEntity();
           
View Full Code Here

                "default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        getLog(emf).trace("verifyDefaultValidationGroup(" + flush + ")");
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
        try {
            DefGrpEntity dge = new DefGrpEntity();
            // Test pre-persist with default group with flush after persist
            // 1a) pre-persist
View Full Code Here

                "non-default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        getLog(emf).trace("verifyNonDefaultValidationGroup(" + flush + ")");
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
        try {
            NonDefGrpEntity ndge = new NonDefGrpEntity();
            // Test pre-persist with non-default group with flush after persist
            try {
View Full Code Here

                "default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        getLog(emf).trace("verifyDefaultPreRemove(" + flush + ")");
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);

        try {
            // Add an entity
            DefGrpEntity dge = new DefGrpEntity();
View Full Code Here

                "pre-remove-default-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        getLog(emf).trace("verifySpecifiedDefaultPreRemove(" + flush + ")");
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);

        try {
            // Add an entity
            DefGrpEntity dge = new DefGrpEntity();
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.