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
0
votes
1 answer

EJB/Hibernate does not access MySQL Database

I'm trying to learn how to work with JavaEE/EJB and database persistence, I have a basic example where I want to save a String to a database via input field and read the list of saved items. I have a MySQL server installed on localhost (V5.7…
0
votes
0 answers

Define Entity Class at Runtime Instead Of Only In Persistence.xml

I see that this question has been asked before, but I haven't seen any answered in a number of years. The answers from previous years which I was able to find were not adequate. Is there a way to load/set/define entity classes for a persistence unit…
Baba
  • 79
  • 1
  • 12
0
votes
1 answer

Java Netbeans: Editing the MySQL DB connection infos

I just created a new project with NetBeans using the database template to connect to a MySQL database. After searching a while I got a question and hope anyone can help me with that: I want to create a dialog in my application to change the…
Kevin Goedecke
  • 1,553
  • 2
  • 14
  • 26
0
votes
1 answer

Eclipselink: error writing objects to/retrieving objects from persistence database

I recently switched development machines and now writing objects to/retrieving objects from the persistence database is not working any longer. This happens when I try to debug the webapp project on my new machine. It works on my old laptop but…
Scyla101
  • 230
  • 3
  • 18
0
votes
1 answer

Configuration of persistence.xml while using websphere 8.5.5.1

I'm coding an app that uses Servlet 3.0, Jsp, and JPA 2.0 and i'm deploying it into Websphere application server 8.5. Since i already configured into the ibm websphere console, the data source and the jdbc driver, and the j2c authentification (i'm…
0
votes
1 answer

persistance.xml doesn't create database in Intellij

I faced a really big problem with creating database using persistent.xml . Ok, i start from the beginning. I created a maven (artifact ->webapp) project. I added a META-INF directory with file persistence.xml into my source directory like…
0
votes
3 answers

How do you use JTA in EclipseLink?

We need to replace the user defined properties of database details with the JTA tag using Eclipse Link. I have the below persistence.xml working with DB values.
user1111880
  • 443
  • 5
  • 8
  • 26
0
votes
0 answers

Reference a jar file in the persistence.xml within a Spring Boot project

I'm trying to setup a Spring Boot application with openJPA and an external persistence unit jar file. But I'm stuck with the error message on Maven build: The jar resource "lib/foo-persistence-unit-1.0.0jar" cannot be loaded. I guess the persistence…
Michel
  • 9,220
  • 13
  • 44
  • 59
0
votes
2 answers

JPA 2.0 Ehcache configuration for L2 cache throwing Error

I am trying to configure Ehcache for JPA 2.0. first i have setup following into persistance.xml
0
votes
1 answer

How can I comment in the file denoted by javax.persistence.sql-load-script-source

I'm using javax.persistence.sql-load-script-source for my unit testing. Is there any standard way to put comments on the script? The file contains insert statements for my entities. INSERT INTO ... (...) VALUES (...) -- 1 INSERT INTO ... (...)…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
0
votes
1 answer

Implementing role based security in EJB, JPA, JSF application in JBoss

We are planning an application using EJB, JPA (persistence) & JSF (Primefaces) architecture on JBoss EAP 6.4. The way data is stored in the database or the nature of the application is, we need to use/implement Role Based Security from application…
MJN
  • 1
  • 1
0
votes
1 answer

Hibernate query return empty list after deployment

guys, I have some problems setting up my endpoints in my project.I am using using wildfly 10.1.0.Final, hibernate ogm 5.0.10.Final and Cassandra 3.0.9. I have 32 rows in a table named "IO_CONFIGURATION" in my cassandra database. Here is the code for…
LebroNan
  • 149
  • 7
  • 18
0
votes
1 answer

EJB persistence not working

I have a example EJB persistence with EJB module run on Jboss 5GA , JDK 6 . Default package have 3 file : Book.java : import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import…
jack ma
  • 21
  • 1
  • 4
0
votes
1 answer

Wildfly 10.0.0.Final - persistence.xml jar-file element not properly supported when using eclipselink

In wildfly 10.0.0.Final, eclipselink does not seem to be properly supported. Sure, hibernate is the default JPA provided for wildfly, but enabling eclipselink module is supported and using eclipselink is quite possible. However, the jar-file…
99Sono
  • 3,554
  • 27
  • 39
0
votes
0 answers

Wilfdly not picking up mysql hibernate configuration in persistence.xml

i'm having difficulty get Wildfly to use MySQL as a database, no connections are made. I have the following in the persistence.xml file: