jpa-2.1

Supported source version RELEASE_6 from annotation processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor less than source1.7

做~自己de王妃 提交于 2019-11-30 11:39:43
I have an enterprise application running in the following environment. Mojarra 2.2.7 PrimeFaces 5.0 final PrimeFaces Extension 2.0 final OmniFaces 1.8.1 EclipseLink 2.5.2 having JPA 2.1 GlashFish 4.0 NetBeans IDE 8.0 JDK 1.7 I have changed the source levels to 1.7 from 1.6 in the project.properties file under nbproject in all three modules (Java EE module, EJB module and WAR module) to have support for Java EE 7. It is not a Maven project. j2ee.platform=1.7 javac.source=1.7 javac.target=1.7 Earlier they all were 1.6. After these changes, the following warning appears while cleaning the project

Hibernate fails to load JPA 2.1 Converter when loaded with spring-boot and spring-data-jpa

亡梦爱人 提交于 2019-11-30 11:29:48
I have a custom converter for UUID to transfer it to a string instead a binary: package de.kaiserpfalzEdv.commons.jee.db; import javax.persistence.AttributeConverter; import javax.persistence.Converter; import java.util.UUID; @Converter(autoApply = true) public class UUIDJPAConverter implements AttributeConverter<UUID, String> { @Override public String convertToDatabaseColumn(UUID attribute) { return attribute.toString(); } @Override public UUID convertToEntityAttribute(String dbData) { return UUID.fromString(dbData); } } The converters (i have some other espacially for time/date handling)

Named Entity Graph Sub-Subgraph

泄露秘密 提交于 2019-11-30 07:58:04
I am new to JPA 2.1 and started using only recently Named Entity Graphs. For my project I am mapping the following relation in JPA 2.1: Order -> OrderDetail -> Product -> ProductLine The question: I want to instruct JPA to join and fetch properly all the needed data. So far this works flawlessly for Order -> OrderDetail -> Product but I have not managed so far to add a Sub-Sub Graph in order to go as deep as the ProductLine class. How do I make a subgraph of a subgraph ? Ex get the ProductLine of the Product ? Here are my entities (getters and setters omitted): Order @Entity @Table(name=

org.hibernate.QueryException: illegal attempt to dereference collection

百般思念 提交于 2019-11-29 22:47:46
I am trying following hql query to execute SELECT count(*) FROM BillDetails as bd WHERE bd.billProductSet.product.id = 1002 AND bd.client.id = 1 But it is showing org.hibernate.QueryException: illegal attempt to dereference collection [billdetail0_.bill_no.billProductSet] with element property reference [product] [select count(*) from iland.hbm.BillDetails as bd where bd.billProductSet.product.id=1001 and bd.client.id=1] at org.hibernate.hql.ast.tree.DotNode$1.buildIllegalCollectionDereferenceException(DotNode.java:68) at org.hibernate.hql.ast.tree.DotNode.checkLhsIsNotCollection(DotNode.java

Supported source version RELEASE_6 from annotation processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor less than source1.7

。_饼干妹妹 提交于 2019-11-29 17:12:05
问题 I have an enterprise application running in the following environment. Mojarra 2.2.7 PrimeFaces 5.0 final PrimeFaces Extension 2.0 final OmniFaces 1.8.1 EclipseLink 2.5.2 having JPA 2.1 GlashFish 4.0 NetBeans IDE 8.0 JDK 1.7 I have changed the source levels to 1.7 from 1.6 in the project.properties file under nbproject in all three modules (Java EE module, EJB module and WAR module) to have support for Java EE 7. It is not a Maven project. j2ee.platform=1.7 javac.source=1.7 javac.target=1.7

JPA 2.1/Hibernate 4.3 deprecation warning

有些话、适合烂在心里 提交于 2019-11-29 13:45:36
I'm using JPA 2.1 sample application with Hibernate 4.3.x implementation. <?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://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="unit1"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>net.roseindia.model.Product</class> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

Hibernate fails to load JPA 2.1 Converter when loaded with spring-boot and spring-data-jpa

僤鯓⒐⒋嵵緔 提交于 2019-11-29 11:42:47
问题 I have a custom converter for UUID to transfer it to a string instead a binary: package de.kaiserpfalzEdv.commons.jee.db; import javax.persistence.AttributeConverter; import javax.persistence.Converter; import java.util.UUID; @Converter(autoApply = true) public class UUIDJPAConverter implements AttributeConverter<UUID, String> { @Override public String convertToDatabaseColumn(UUID attribute) { return attribute.toString(); } @Override public UUID convertToEntityAttribute(String dbData) {

Hibernate Envers fails with @Converter and AttributeConverter (JPA 2.1)

穿精又带淫゛_ 提交于 2019-11-29 04:38:29
I am using Hibernate 4.3.4 with Envers, and MySql 5.6. Without a JPA 2.1 converter, the Party entity below fails at Configuration.buildSessionFactory() as it should, since Hibernate doesn't know what to do with the Name class: @Entity @Audited public class Party { protected Name name; ... } The exception is: org.hibernate.MappingException: Could not determine type for: ModuloADM.Party.Name, at table: Party, for columns: [org.hibernate.mapping.Column(name)] To fix this, I then add this converter: @Converter (autoApply=true) public class NametoStringConverter implements AttributeConverter<Name,

Exclude JPA 2.0 from JBoss 7.1 in order to use hibernate 4.3

浪尽此生 提交于 2019-11-29 01:42:19
问题 I want to use hibernate 4.3 for its multitenancy features in JBoss 7.1. I managed to include it in my war by adding the following lines in jboss-deployment-structure <exclusions> <module name="org.hibernate" /> </exclusions> and adding a dependency to hibernate core and entity manager in my pom.xml This made hibernate 4.3 to load but unfortunately I got an error java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index; which is due to JPA 2.0 being loaded when

How to specify JPA 2.1 in persistence.xml?

放肆的年华 提交于 2019-11-28 17:23:37
A quick search on the net reveals 3 or 4 variants how folks have been specifying xmlns and xsi:schemaLocation in persistence.xml . What would be the 'correct' manner to specify JPA version 2.1? I'm using: <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://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> Andrei I According to the official documentation it must be (like yours): <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi