persistence.xml

JPA default persistence unit

I get exception "There is no default persistence unit in this deployment." can I somehow mark unit as default?(I have only one persistence unit, so Id rather not call it by name) ...

Encrypting Parameters in persistence.xml

We have a batch application using OpenJPA. We are specifying all the DB connection parameters in persistence.xml. Although its a functional setup it looks very insecure to have all the ip,username,password in clear text and a serious concern in production. As it is a standalone batch app we cant use server configurations etc. Is there a...

How to use Hibernate SchemaUpdate class with a JPA persistence.xml?

I've a main method using SchemaUpdate to display at the console what tables to alter/create and it works fine in my Hibernate project: public static void main(String[] args) throws IOException { //first we prepare the configuration Properties hibProps = new Properties(); hibProps.load(Thread.currentThread().getContextClassLoader(...

JPA 2.0, hiberante 3.5, jars & persistence.xml location

I'm building a desktop application using hibernate 3.5 & JPA 2.0. I have 2 jars, the lib, which defines every entity and DAO, packages looks like this : org.my.package.models org.my.package.models.dao org.my.package.models.utils In org.my.package.utils I defined my hibernate utility class for getting EM & EMF instances, which mean...

JPA persistence.xml share same jar file

Hi! I'm wondering if I can share the same jar file for several persistence units.. I mean: I have two persistence units described in my persistence.xml file and the entities are not in the same JAR. Entities are in a separated JAR file but, in that one, there are entites for both persistence units. I think I red somewhere that I coould u...

Combine two or more persistence.xml(s) into one , when packaging (war) many modules (Maven)

I have a maven-managed project with some modules (with jar package) , each module contains its "persistence.xml" in its META-INF directory. Another module take responsibilities to package these modules into a war file . But I find no way to "combine" these "persistence.xml" into one file ... Is it possible ? Thanks in advanced. ...

How to detect entities automatically with openJPA?

I'm looking for an entity detection in OpenJPA. That I don't need to declare all entities in the persistence.xml. Edit: I'm sorry, I forgot to say that I develop a java se app. ...

it's possible configure a persistence.xml for multiple data sources??

hi i just want to know how configure in a persistence.xml two datasources one of the data sources have a jar outside from the other. I'm tried but i really don't if it's possible ...

JPA and toplink create-table on if they don't already exist?

Looks like jpa is something which makes me ask a lot of questions. Having added this <property name="toplink.ddl-generation" value="create-tables"/> my JPA application always creates tables when running, which results in exceptions in case the tables already exist. I would like JPA to check if the tables already exist and if not crea...

How to specify a jdbc.url in the persistence.xml relative to the application folder?

Once I deploy my application with JPA the user chooses to install it somewhere. Then however the property set as: <property name="javax.persistence.jdbc.url" value="jdbc:derby:db;create=true"/> gets interpreted into the following exception: couldn't create database in \db. Throughout development it used to be the relative path to the ...

Persistence deployment issue

I have a hibernate project, which uses JPA. my persistence.xml contents is as follows: <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;...

Problems with generating sql via eclipseLink - missing separator

hi folks, i'am using eclipseLink with jpa. in my persistence.xml, i defined to generate a create.sql file. the file will be generated, but with missing ';'-separators for each sql statement. is there a possibility to define a separator in the persistence.xml or in some other way? regards bva Example persistence.xml: <provider>o...

Is it possible to share configuration from persistence.xml?

I have one persistence unit configured in my persistence.xml but i have two databases. Those databases are identical, regarding the schema. What i am trying to do is: Persistence.createEntityManagerFactory("unit", primaryProperties); Persistence.createEntityManagerFactory("unit", secondaryProperties); The properties contain different ...

How can I manage to use 2 persistense units and make my app to recognize which to use?

I hava a JavaEE/ EJB3 application in which I'll need to connect diferent databases. It's on JBOSS 5.10GA. After I tried to deploy it I got the following error: 09:04:57,921 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/opt/jboss-5.1.0.GA/server/idiomas/deploy/idiomas.ear/ state=PreReal mode=Manual requiredStat...

persistence.xml not found on glassfish deployment descriptor (IntelliJ)

I have an EJB and a WEB module in my IntelliJ, created 5 entities that I would hope to load into a database using annotations. I go to project settings, under modules, and select that I want to add JPA facet, I know have a EJB, WEB and JPA facet. I use eclipselink, so I checked that under JPA settings, I then added my persistence.xml f...