Questions tagged [hibernate-jpa]
53 questions
0
votes
1 answer
Issue in persistence.xml for Oracle DB
I am getting below error :org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 77; schema_reference.4: Failed to read schema document 'http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd', because 1) could not find the document; 2)…

Gps
- 31
- 1
- 5
0
votes
2 answers
Unable to remove foreign key constraint in hibernate
I am trying to delete one object from my project.
It is dependent on many other classes. I understand that I need to free that object from all other dependencies. I tried to delete all its dependencies but still I am getting the Foreign key…

Jon B
- 71
- 1
- 7
0
votes
1 answer
java.lang.Exception: Not an entity: class com.domain.package.User
I am migrating entity mapping from an annotations app to hbm.xml
I error this error and not found the solution. Thanks
java.lang.Exception: Not an entity: class com.enterprise.package.user.domain.User
I have hibernate.cfg.xml in the resources…
0
votes
1 answer
Quarkus extension for spring data API - automatic repository implementation generation
I am trying to migrate a spring project in quarkus and I am using quarkus extension for spring data API.
As they said in the quarkus doc : Interfaces that extend org.springframework.data.repository.Repository are automatically implemented and the…

Thierno DIALLO
- 133
- 1
- 7
0
votes
0 answers
OneToOne mapping issue for non primary field
I am trying to map a non primary key column between 2 tables using one-to-one mapping through JPA.
The OneToOne is not performing the join on the mentioned column rather it is picking up the Id field.
Below is the table structure:
Person table
id…

Pooja
- 3
- 2
0
votes
0 answers
After Hibernate JPA persist - record is not in the database
I face following issue while trying to write some JBehave BDD test. Scenario is the following:
Due to an MQ message some specific records should be saved into my database and some should be deleted from it. In my @When step I send the given message…

dorcsi
- 295
- 2
- 6
- 24
0
votes
2 answers
How to find if a result is falling between 2 dates in the lucene index?
I'm trying to find if the expiry date falls between today and another date specified. Though my database has results, the search query doesn't seem to fetch the value. Please help!
This is the query that's being run:
jpaQuery:…
0
votes
1 answer
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: jpa
After adding AND condition to the below mentioned query
String querys = "SELECT…

arjun
- 107
- 1
- 1
- 12
0
votes
1 answer
Implement JPA request with JOIN
I have these 3 entities:
Payment Transactions:
@Entity
@Table(name = "payment_transactions")
public class PaymentTransactions implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique =…

Peter Penzov
- 1,126
- 134
- 430
- 808
0
votes
0 answers
How to use two joins in jpa in topredacte method
I am using a jpa with spring boot and I'm newbie with this. I have override
Predicate toPredicate() of Specification. below is my code:-
public Predicate toPredicate(Root root, CriteriaQuery> criteriaQuery, CriteriaBuilder…

amit kumar
- 121
- 1
- 10
0
votes
0 answers
How to use specification for a custom JPQL query
Is there any way to add Specification for a custom JPQL query like below :
I am able to create custom jpql, but not sure how to add additional specification conditions to it. I need to add specification…

Async Code
- 51
- 9
0
votes
1 answer
How to fetch an entity having a timestamp property that is within an hour from other timestamp property with JPA and Hibernate
I have a doubt in JPA query criteria builder with path or expression.
I want to find who are all entered first post comment with in an hour after their account created
Path accountCreatedTime = root.…

Ram
- 37
- 4
0
votes
1 answer
"ERROR: ORA-00911: invalid character " for create tables by Hibernate JPA
I want create two tables with Hibernate JPA .
I use Oracle 11g and JDBC 6 & 7 (Because I'm not sure which one is suitable for 11g :) ).
my library : hibernate-release-4.2.0.Final & hibernate-jpa-2.0-api-1.0.1 & Tomcat-8 lib & JDK 1.8.0-172
I…

Farzane Sadeghi
- 39
- 2
- 13
0
votes
1 answer
Grouping columns within entity
I have a table with 2 columns for phone number(area code and number). When I define entity, I can do it with 2 different variable to match column names.
However, when i use it in jparepository, I want to search with a phone number (which will be a…

CheckThisOut
- 3
- 2
0
votes
1 answer
Map sql query result to java object(in Non-Entity class) using spring jpa
I want to assign SQL query result to Java object which is in non-entity class.
My query is counting the number of records in Table A mapped to another Table B.
@Query(value="select count(a.id) from table1 a join table2 b on a.id=b.id group by a.id",…

Lingesh
- 11
- 8