Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Validating schema

Gili
	Hi, good question.  For most of the elements and properties it should.
	There is one case that it will not qualify (your schema on the db).
	In the case that you are using a JTA datasource (RESOURCE_LOCAL probably as well) - then that datasource will not be used until you do something that requires a transaction with some of your entities or you do a query on them.  The datasource is set on the PersistenceUnitInfoImpl in predeploy() but we only use it and get a connection in JNDIConnector.connect() during a crud operation.

	thank you
	/michael
 
-----Original Message-----
From: cowwoc [mailto:cowwoc@xxxxxxxxxxxxxxxx]
Sent: Thursday, September 04, 2008 14:01
To: eclipselink-users@xxxxxxxxxxx
Subject: [eclipselink-users] Validating schema


Hi,

    I'd like to add a JUnit test which will validate persistence.xml and 
any associated database schema, annotations, etc. Is the following code 
enough?

        EntityManagerFactory emf = 
Persistence.createEntityManagerFactory("MyPersistenceUnit");
        EntityManager em = emf.createEntityManager();
        em.close();

    Or do I need to do anything special? Also, is there a way to disable 
this validate for production machines?

Thank you,
Gili
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top