JPA Stored procedur. : Parameter number X is not an OUT parameter - java

I am trying to execute stored procedure using hibernate. I face following issue. Starting to learn hibernate, and the proc is very simple, but not able to identify the issue.
Any guidance how i can resolve this, will be helpfull.
Stored Proc:
CREATE PROCEDURE `GET_TOTAL`(IN sno int, OUT count_out int)
BEGIN
SELECT COUNT(*) into count_out from table2 WHERE sno = sno ;
END
Java:
package database.hibernate_v2.hibernate_v2;
import javax.persistence.EntityManager;
import javax.persistence.ParameterMode;
import javax.persistence.StoredProcedureQuery;
public class App4 {
public static void main( String[] args )
{
EntityManager entityManager = JPAUtility.getEntityManager();
entityManager.getTransaction().begin();
StoredProcedureQuery storedProcedure = entityManager.createStoredProcedureQuery("GET_TOTAL");
// set parameters
storedProcedure.registerStoredProcedureParameter(1, Integer.class, ParameterMode.IN);
storedProcedure.registerStoredProcedureParameter(2, Integer.class, ParameterMode.OUT);
//storedProcedure.registerStoredProcedureParameter("out1", Integer.class, ParameterMode.OUT);
storedProcedure.setParameter(1, 1);
//storedProcedure.setParameter("out1", 1);
storedProcedure.execute();
}
}
persistence.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence 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"
version="2.0">
<persistence-unit name="agisdb">
<description>JPA Demo</description>
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/testDB1?useSSL=false"/>
<property name="javax.persistence.jdbc.user" value="xxxxx"/>
<property name="javax.persistence.jdbc.password" value="xxxxx"/>
</properties>
</persistence-unit>
</persistence>
Error: The parameter 2 for the stored proc is "OUT" parameter, but not sure why i get error message "Parameter number 2 is not an OUT parameter".
ERROR: Parameter number 2 is not an OUT parameter
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Error preparing CallableStatement
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:456)
at org.hibernate.procedure.internal.ProcedureCallImpl.getOutputs(ProcedureCallImpl.java:404)
at org.hibernate.procedure.internal.ProcedureCallImpl.outputs(ProcedureCallImpl.java:663)
at org.hibernate.procedure.internal.ProcedureCallImpl.executeUpdate(ProcedureCallImpl.java:680)
at database.hibernate_v2.hibernate_v2.App4.main(App4.java:23)
Caused by: java.sql.SQLException: Parameter number 2 is not an OUT parameter
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
at com.mysql.jdbc.CallableStatement.checkIsOutputParam(CallableStatement.java:630)
at com.mysql.jdbc.CallableStatement.registerOutParameter(CallableStatement.java:1807)
at org.hibernate.procedure.internal.AbstractParameterRegistrationImpl.prepare(AbstractParameterRegistrationImpl.java:291)
at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:444)
... 4 more

Related

JPA connect to Derby Database with Hibernate-ORM related problem in Quarkus

Currently, I am trying to build an API with JPA and Derby Database, and I've got some problems with Hibernate Reactive/Hibernate ORM.
Particularly, I want to connect to a Derby database server as follows:
QueryService.java:
#Transactional
#RequestScoped
public class QueryService implements Serializable {
#PersistenceContext
EntityManagerFactory emf;
private final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public QueryService() {}
#PostConstruct
public void init() {
String urlDB = "my-persistence-unit";
emf = Persistence.createEntityManagerFactory(urlDB);
}
#PreDestroy
public void destroy() {
emf.close();
}
application.properties:
quarkus.hibernate-orm.database.generation=none
quarkus.datasource.db-kind=derby
quarkus.datasource.jdbc.url=jdbc:derby://localhost:1527/appDB;create=true
quarkus.datasource.jdbc.driver=org.apache.derby.jdbc.ClientDriver
quarkus.datasource.username=admin
quarkus.datasource.password=admin
quarkus.live-reload.instrumentation=true
In the persistence.xml file, I define a persistence unit to be used by the EntityManagerFactory in QueryService.java.
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit
name="my-persistence-unit"
transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.connection.url" value="jdbc:derby://localhost:1527/appDB;create=true"/>
<property name="hibernate.connection.username" value="admin"/>
<property name="hibernate.connection.password" value="admin"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
If I run this, I get this error: { "details": "Error id 07333181-bf2e-4640-8497-01de9bf6ccf7-1, java.lang.NullPointerException: Cannot invoke \"io.quarkus.hibernate.orm.runtime.recording.RecordedState.isReactive()\" because \"recordedState\" is null", "stack": "java.lang.NullPointerException: Cannot invoke \"io.quarkus.hibernate.orm.runtime.recording.RecordedState.isReactive()\" because \"recordedState\" is null\r\n\tat io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(FastBootHibernatePersistenceProvider.java:172)\r\n\tat io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:66)\r\n\tat javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)\r\n\tat javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)\r\n\tat app.QueryService.init(QueryService.java:29)\r\n\tat app.QueryService_Bean.create(Unknown Source)\r\n\tat app.QueryService_Bean.create(Unknown Source)\r\n\tat io.quarkus.arc.impl.RequestContext.getIfActive(RequestContext.java:74)\r\n\tat io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:30)\r\n\tat app.QueryService_ClientProxy.arc$delegate(Unknown Source)\r\n\tat app.QueryService_ClientProxy.obtainCourseList(Unknown Source)\r\n\tat app.Scolarite.obtainCourseList(Scolarite.java:49)\r\n\tat app.Scolarite_Subclass.obtainCourseList$$superforward1(Unknown Source)\r\n\tat app.Scolarite_Subclass$$function$$2.apply(Unknown Source)\r\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:133)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:104)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.doIntercept(TransactionalInterceptorRequired.java:38)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:58)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:32)\r\n\tat io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired_Bean.intercept(Unknown Source)\r\n\tat io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)\r\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)\r\n\tat io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:33)\r\n\tat app.Scolarite_Subclass.obtainCourseList(Unknown Source)\r\n\tat app.Scolarite_ClientProxy.obtainCourseList(Unknown Source)\r\n\tat app.ScolariteApplication.getCourseList(ScolariteApplication.java:22)\r\n\tat app.ScolariteApplication$quarkusrestinvoker$getCourseList_9c2e0d4fdac50820476d652c171e60223f72a1d5.invoke(Unknown Source)\r\n\tat org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)\r\n\tat io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:114)\r\n\tat org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)\r\n\tat io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)\r\n\tat org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)\r\n\tat org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)\r\n\tat org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)\r\n\tat org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)\r\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\r\n\tat java.base/java.lang.Thread.run(Thread.java:833)" }
I tried to search for this on the internet, and it is said that this was because Hibernate Reactive and Hibernate Orm cannot be used together. But I don't know how to solve it. I am quite new to this. Could you please help me with it?

MySQL geospatial data (POINT) and JPA in Netbeans

I need to just fetch some geospatial data (simple coordinates - POINTS) from MySQL db and use them in Java (NetBeans project). This is what I did so far:
Created MySQL db with following table:
CREATE TABLE `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lokacija` point DEFAULT NULL,
`info` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
I also created NetBeans project and set up JPA and everything, added hibernate-spatial library to it and here is my persistence.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="testGisPU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>model.Test</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.spatial.dialect.mysql.MySQLSpatialDialect"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:8889/dipl?zeroDateTimeBehavior=convertToNull"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.password" value="root"/>
</properties>
</persistence-unit>
</persistence>
After that, created entity and besides all other properties, it also contains following:
...
#Column(name = "lokacija")
#Type(type="org.hibernate.spatial.GeometryType")
private Point lokacija;
#Column(name = "info")
private String info;
...
I also generated REST facade directly from NetBeans and I tried to print all items I fetch from the db (currently I have only two items with descriptions "first" and "second" and locations (1,1)) and here is what I get:
LOCATION: null
INFO: first
LOCATION: null
INFO: second
Any suggestions what else I should do in order to make this work?

Hibernate - named query not known

I have a weird problem. I googled many solutions in the internet, but no one was helpful.
I have this simple method to get information from my database:
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.getCurrentSession();
session.beginTransaction();
Query query = session.getNamedQuery("User.findByHash");
query.setString("hash", hash);
query.setDate("hash", new Date());
List<?> list = query.list();
User user = (User) list.get(0);
session.getTransaction().commit();
And this returns me an error:
Exception in thread "main" org.hibernate.MappingException: Named query
not known: User.findByHash at
org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:93)
at
org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483) at
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:345)
at com.sun.proxy.$Proxy0.getNamedQuery(Unknown Source)
at wroproject.UserConnection._getUserByHash(UserConnection.java:44)
at wroproject.UserConnection.(UserConnection.java:26)
at wroproject.Main.main(Main.java:19)
The top of the User.java file looks like this:
#Entity
#Table(name = "user", catalog = "wroproject", schema = "public")
#XmlRootElement
#NamedQueries({
#NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
#NamedQuery(name = "User.findById", query = "SELECT u FROM User u WHERE u.id = :id"),
#NamedQuery(name = "User.findByPassword", query = "SELECT u FROM User u WHERE u.password = :password"),
#NamedQuery(name = "User.findByHash", query = "SELECT \"user\".* FROM \"user\" LEFT JOIN session on \"user\".id = session.user_id WHERE session.hash = :hash AND date_time_terminate < :date")
})
public class User implements Serializable {...}
My fibernate.cfg.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/wroproject</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.connection.password">postgres</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
And persistence.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<persistence-unit name="WroProjectPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>wrocproject.db.User</class>
<class>wrocproject.db.Email</class>
<class>wrocproject.db.Session</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/wroproject"/>
<property name="javax.persistence.jdbc.password" value="postgres"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="javax.persistence.jdbc.user" value="postgres"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
What should I do?
It is odd to me that you are using both a hibernate.cfg.xml and a persistence.xml file to configure hibernate. If you are using hibernate-core, then use hibernate.cfg.xml, if you are using hibernate-entitymanager, use persistence.xml.
Since you are using SessionFactory, your persistence.xml is probably being ignored for configuration. Since persistence.xml is where you specify what your entities are, I suspect none of your entities are being mapped. You can test this by just trying to load the entity without using a stored procedure:
session.get(User.class, id);
Also you could turn on logging and see what entities are being registered when you create a SessionFactory.
In the query are this parameters:
hash AND date_time_terminate
Change :
Query query = session.getNamedQuery("User.findByHash");
query.setString("hash", hash);
query.setDate("hash", new Date());
By:
Query query = session.getNamedQuery("User.findByHash");
query.setString("hash", hash);
query.setDate("date_time_terminate", new Date());

Glassfish 4 - TransactionRequiredException using Hibernate and CDI #Transactional

I am getting the following exception:
javax.el.ELException: javax.persistence.TransactionRequiredException
at com.sun.el.parser.AstValue.invoke(AstValue.java:279)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
Caused by: javax.persistence.TransactionRequiredException
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.doTxRequiredCheck(EntityManagerWrapper.java:161)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.doTransactionScopedTxCheck(EntityManagerWrapper.java:151)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:299)
I am using Hibernate 4.3.5
#Named
#SessionScoped
public class MenuBean implements Serializable {
#PersistenceContext
private EntityManager entityManager;
#Transactional
public void create() {
MenuTitle menu = new MenuTitle();
menu.setLabel(label);
entityManager.persist(menu); //exception in this line
label = null;
}
Persistence XML:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="MyPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>MySQL5</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.current_session_context_class" value="jta"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
</properties>
</persistence-unit>
I have also tried to set hibernate.transaction.jta.platform to org.hibernate.engine.transaction.jta.platform.internal.SunOneJtaPlatform but it results in the same error.
EJB CMT´s are working fine.
The Create action is called from a commandButton:
<p:commandButton value="Create" process="#this type" update=":megaMenuForm:mainMenu" actionListener="#{menuBean.create()}" oncomplete="closeMenuDialog(xhr, status, args)"/>
See EJB specs if you want to manage transaction. Inject a resource UserTransaction.
Also #Transactional with not do anything here since you are using EJB.
In general you example should work, and #Transactional annotation will be just ignored. Could you try to make an interface, and call create method through it?
Looks like you are using EJB 2 style coding, but Glassfish 4 implements EJB 3.1, so it is better to go with a new one.

Is there a non-commercial Hibernate query checker?

We are using Hibernate at my workplace on some project and I had to modify some queryes recently. I found it really cumbersome to modify a query, run an ant smart or ant refresh and see whether my query works. When I asked one of my colleagues he told me that it is the way we use it.
Do you have any idea how can I speed up this process? I'm looking for a tool which can connect to a database (we are using PGSQL) and run my Hibernate query there and show the results without touching ant.
For example I would be able to try this:
#Query(query = "SELECT DISTINCT l FROM Line l, IN(l.workplaces) w WHERE w.workshop.sid=:wsid", params = "wsid")
JBoss Tools for eclipse has a HQL editor that you can open from the hibernate perspective, you can test hql queries there.
We have a junit-Test for hibernate which uses the derby database as a in-memory databse. This will create the database in derby with all tables and you should be able to execute the query, to see if it is valid.
We have all queries in the orm.xml, so those queries are already checked when creating the EntityManager.
setup
private static EntityManagerFactory emf;
private static EntityManager em;
#BeforeClass
public static void before()
{
emf = Persistence.createEntityManagerFactory("persistenztest");
em = emf.createEntityManager();
}
test
#Test public void test()
{
Query q = em.createQuery(YOUR_QUERY_HERE);
List<?> list = q.getResultList();
}
Persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="persistenztest" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>orm.xml</mapping-file>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="hibernate.connection.url" value="jdbc:derby:memory:sa;create=true;territory=de_DE;collation=TERRITORY_BASED:SECONDARY;"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cache.use_query_cache" value="false"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="false" />
</properties>
</persistence-unit>
</persistence>

Categories

Resources