Questions tagged [persistence.xml]

Used with the Java Persistence API, specifies names and database properties.

When used with the Java Persistence API, the persistence.xml file is usually placed in the META-INF folder; it's used to specify the persistence provider name, entity class names, and properties like the database connection URL, driver, user, password, and so on (taken from http://www.javaworld.com/javaworld/jw-01-2008/jw-01-jpa1.html?page=3).

519 questions
1
vote
1 answer

DB2, Hibernate, JPA: Schema does not exist

I'm quite new to the subject and I'd like to know what is wrong with what I've done so far. So to establish the database connectioin I created a persistence.xml:
Micromonger
  • 150
  • 10
1
vote
1 answer

Is it possble to write query at JPA entity property level

Is it possble to write query at JPA entity property level? Basically I want to add a property in an entity which is not an actual column and value should computed with query. Something like: @Entity @Table(schema = "quote", name =…
1
vote
1 answer

persistence.xml not working

I have a problem with running a web project with JPA. Netbeans shows the message: The module has not been deployed. See the server log for details. I'm using Glassfish as a server, it shows following error message: Grave: Exception lors du…
1
vote
1 answer

ejb+JPA Multi-tenancy with hibernate4, could not complete schema update: java.lang.NullPointerException

Now I have an application with jpa(hibernate4) mutlitenancy, but there are some exceptions, I use ejb3+jpa+wildfly, I don't know where is wrong, only one message java lang nullponinterexception: Could not complete schema update:…
Xiang Zhou
  • 11
  • 1
1
vote
1 answer

Not able to read orm.xml in multiple module project in jpa

I have configured multi module project using maven ,so I am building the common module which is going to use across the project. Now the problem is I have my Category.orm.xml file inside META-INF/domain/orm directory when i tried to read…
henrycharles
  • 1,019
  • 6
  • 28
  • 66
1
vote
0 answers

why is "hibernate.ejb.event.flush" required in spring persistence.xml

In my persistence.xml, I have What is the role of that property in persistence.xml? What does it mean? Thanks!
hrishikeshp19
  • 8,838
  • 26
  • 78
  • 141
1
vote
1 answer

Spring: not a managed type - separate test project

Initially I built a Maven-Spring application with test cases. It worked well and all tests did pass. But now I have a separate maven project for tests and moved the test classes and the spring xml configuration files that project. I have added the…
kk-dev11
  • 2,654
  • 5
  • 37
  • 48
1
vote
1 answer

JavaMelody monitorking JTA datasource on WildFly

I have some problem with configure JavaMelody to moniotr sql connection in application running on WildFly. This is my configuration: pom net.bull.javamelody javamelody-core
T.G
  • 1,913
  • 1
  • 16
  • 29
1
vote
1 answer

JPA persistence.xml share same jar file

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,…
PaquitoSoft
  • 3,177
  • 6
  • 29
  • 32
1
vote
1 answer

Eclipse do not put the persistence.xml in my ear

I have an issue and I have no idea why. I'm developing a EE maven aplication, everything going well, apparently. The persistence.xml is not packaging in the ear. I have the file in the src/main/resources/META-INF The Java Build Path have the…
Rafael
  • 104
  • 8
1
vote
2 answers

How to change Persistence Unit dynamically?

I have a Spring MVC + Hibernate + JPA app. Also have 4 different Schemas in my db with similar tables. (for different companies) . Now when I'm using my Hibernate app, can i switch Persistence Unit so that I can use same the form (with the same…
LahiruBandara
  • 931
  • 1
  • 9
  • 14
1
vote
0 answers

Clean in Eclipse removes WEB-INF/classes/META-INF/persistence.xml file

I have a dynamic web project in Eclipse LUNA Its targeted to run on Glassfish4 I am using JPA2.1 with Hibernate My persistence.xml file needs to be loacted here WEB-INF/classes/META-INF/persistence.xml however every time I refresh then clean my…
Hector
  • 4,016
  • 21
  • 112
  • 211
1
vote
1 answer

Runtime Enhancement in OSGi environment using code

Problem : 1. JPA Classes/entities are in Bundle 1 and Bundle 2 using same persistence unit 2. Bundle 3 is trying to access(wrapper APIs for DB API abstraction) the classes in Bundle 1 and Bundle 2. 3. Runtime enhancement is not working. So…
1
vote
2 answers

migrate hibernateTemplate to JPA 2 (executeWithNativeSession - doInHibernate)

I am migrating my code from hibernate 3 (that is using hibernate template) to JPA 2. My project is using Spring as well. Current project is using hibernatetempate as hibernateTemplate.executeWithNativeSession(new HibernateCallback() { …
Vik
  • 125
  • 1
  • 9
1
vote
0 answers

How to generate table schema from persistence.xml of jpa 2.1?

I try to generate table schema with script file with eclipse and wildfly 8.1 This is my persistence.xml file.
Joseph Hwang
  • 1,337
  • 3
  • 38
  • 67