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

How to implement Spring's @Transactional Annotation using Hibernate, HikariCP and persistence.xml

I need to implement Spring's @Transactional annotation but I'm not being able to do so. I had tried a lot of methods in the past 3 weeks but none of them worked. I'm also need to use EntityManager. To test if Spring's was working, I tried to inject…
jNewbie
  • 334
  • 1
  • 15
1
vote
1 answer

jersey 2.x JPA issue - org.hibernate.UnknownEntityTypeException: Unable to locate persister

We are implementing Jersey 2.26 in our application and facing issues with EntityManager. We are using JPA and the persistence classes are packaged in a separate jar. Took reference from below link:- How do I properly configure an EntityManager in a…
gari004
  • 11
  • 3
1
vote
0 answers

HSQLDB Tables not generating

I have a database using HSQLDB, and my persistence.xml file is not creating the tables as I would expect. Here is my persistence.xml code:
1
vote
1 answer

Exception while deploying the app Glassfish

I am trying example from below and trying to run it in slightly a different way. Pl note I have downloaded the sourcecode from github and then have done some changes as per my…
Ragini
  • 1,509
  • 7
  • 28
  • 42
1
vote
1 answer

persistence unit gets overwritten

I'm coding a standalone java application, build it from a Maven project and executed by calling the jar file. In the application I have an entity manager using a persistence unit, defined in my persistence.xml to be standalone…
J. Doe
  • 19
  • 4
1
vote
1 answer

Composite Persistence Unit using a single JAR file

I have searched the web and this site already for an answer. Although I found one link through a Google search, I subsequently lost the link and can't find it again. I have been working on an e-commerce web site running on Glassfish 4.1.1 that…
Paul Allen
  • 11
  • 1
  • 6
1
vote
0 answers

Converting from Hibernate hbm.xml to annotations - version "unsaved value"

I'm currently trying to convert from hbm.xml files to annotations. I don't find a documentation how to convert My solution would look like this... @Version …
JavaMan
  • 1,142
  • 12
  • 22
1
vote
1 answer

JPA persistence configuration error

I'm running a standalone EJB project in eclipse using Glashfish server. But it's throwing an error not related to the database I configured. I'm using PostgreSQL and hibernate as JPA provider. Note that I'm just deploying and running the application…
ReturnZero
  • 11
  • 2
1
vote
1 answer

Spring Boot JPA Hibernate + persistence.xml Not Inserting

I am having an issue with inserts not working. Reads (Selects) work okay. However, an insert is not being executed at end of my @Transactional method. Even though I do see the Transaction commit/close being called on the Entity Manager. I have…
1
vote
0 answers

No Persistence provider for EntityManager in prod more

I've been making an app using Play Framework 2.5 and I had no problems while running it in dev mode with run command, but once I try to switch to prod mode I am having this exception: javax.persistence.PersistenceException: No Persistence provider…
Backflip
  • 232
  • 2
  • 9
1
vote
1 answer

How to create only new tables in persistence.xml using JPA with Hibernate?

My persistence.xml file looks like this:
antarkt1s
  • 135
  • 1
  • 2
  • 13
1
vote
1 answer

Unexpected Element in Persistence.xml Entitymanager inject not working

My program was working perfectly fine, till I started to use persistence and with the EntityManager @Inject. There are a lot of errors thrown, but I think this one is the one most blocking. It says something about an unexpected element, but I…
CherryNerd
  • 1,258
  • 1
  • 16
  • 38
1
vote
0 answers

Why did Isolater.doNonTransactedWork go away in hibernate 3?

Why did the hibernate team decide to take away the Isolater class? I was using Isolater.doNonTransactedWork in hibernate 3. Is there any way mimic the same functionality as Isolater.doNonTransactedWork in hibernate 5?
1
vote
1 answer

Persistence.xml in the right folder, but I still get an error

I am configuring from scratch a new project using Gradle: apply plugin: 'java-library' repositories { mavenCentral() } dependencies { compile 'org.hsqldb:hsqldb:2.3.4' compile 'javax.persistence:persistence-api:1.0.2' compile…
1
vote
1 answer

How to override the persistent xml file in junit class which will be used in other java class?

I have a junit test class in which I have to specify the new persistent unit name suppose say "B" with properties connecting to the DB. From this test class I am invoking a JPA REST service which in turn calls a business logic java class. In this…
agrawalsp
  • 31
  • 10