Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI


        closeEMF(accessEMF);
    }


    public void testSQLServerDynamicSchema() {
        OpenJPAEntityManagerFactorySPI sqlserverEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:microsoft:sqlserver:",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here


        closeEMF(sqlserverEMF);
    }


    public void testMySQLDynamicSchema() {
        OpenJPAEntityManagerFactorySPI mysqlEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:mysql://host1:1,host2:2/database?p1=v1&p2=v2",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here

        closeEMF(mysqlEMF);
    }


    public void testPostgresDynamicSchema() {
        OpenJPAEntityManagerFactorySPI postgresEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:postgresql:database",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here

        closeEMF(postgresEMF);
    }


    public void testInformixDynamicSchema() {
        OpenJPAEntityManagerFactorySPI informixEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:informix-sqli:",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here

        closeEMF(informixEMF);
    }


    public void testSybaseDynamicSchema() {
        OpenJPAEntityManagerFactorySPI sybaseEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:sybase:Tds:host:1234?ServiceName=db",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here

        closeEMF(sybaseEMF);
    }


    public void testFirebirdDynamicSchema() {
        OpenJPAEntityManagerFactorySPI firebirdEMF =
            createEMF(EntityVeryLongNames.class, EntityReservedWords.class,
                "openjpa.ConnectionURL",
                "jdbc:firebirdsql:host/1234:database",
                "openjpa.jdbc.SynchronizeMappings", "export",
                "openjpa.jdbc.SchemaFactory", "dynamic", RETAIN_DATA);
View Full Code Here

    /**
     *  1h) PrePersist only called when pre-persist validation group defined
     *      (ie. per-persist and pre-remove are disabled).
     */
    public void testPersistOnlyValidationGroup() {
        OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI)
        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

     * 2b1) verify multiple/mixed validation groups via persistence.xml
     * @param flush
     */
    public void testPesistenceXMLMultipleValidationGroups() {

        OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI)
        OpenJPAPersistence.createEntityManagerFactory(
                "multi-validation-group-xml",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        verifyMultipleValidationGroups(emf);
View Full Code Here

            "");

        propMap.put("javax.persistence.validation.group.pre-remove",
            "org.apache.openjpa.integration.validation.ValGroup2");

        OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI)
        OpenJPAPersistence.createEntityManagerFactory(
                "multi-validation-group",
                "org/apache/openjpa/integration/validation/persistence.xml",
                propMap);
        assertNotNull(emf);
View Full Code Here

        Map<String, Object> propMap = new HashMap<String, Object>();
        propMap.put("javax.persistence.validation.group.pre-persist","");

        propMap.put("javax.persistence.validation.group.pre-update","");

        OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI)
        OpenJPAPersistence.createEntityManagerFactory(
                "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

TOP

Related Classes of org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI

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.