SQL « Field « JPA Q&A

1. Optimizing a query - using a field or using another table    stackoverflow.com

I have a query which takes a long time and I want to optimize it. I'm looking for the most efficient way to do it. I'm working on Hibernate/JPA with Postgresql DB ...

2. Can JPA Entity with @transiet field store data from SQL query resultset?    stackoverflow.com


class Table_A{
    private long ID;

    private String name;


3. java.sql.SQLException: Field 'passwordConfirmation' doesn't    forum.hibernate.org

I've been scratching my head over this error for sometime now but can't work it out. I've been using Hibernate 3 to persist User entity. But I am getting java.sql.SQLException: Field 'passwordConfirmation' doesn't have a default value error when I try to do that. Following is my User entity: User.java Code: @Entity public class User implements Serializable { ...

4. colletcions fields and direct sql query    forum.hibernate.org

5. How to query part of fields with named SQL query?    forum.hibernate.org

Why do you want to use an sql-query? You can use an HQL named query. select new YourClass'sName (user.grade,count(*) count from User user where user.name like 'A%' group by user.grade If you DO wnat to use an sql-query, select new YourClass'sName (user.grade,count(*) count from User user where user.name like 'A%' group by user.grade ...

6. Using the sql function to set the field value.    forum.hibernate.org

Hibernate Version: 2.1.6. Database: Sybase 11.9.2 I have a pojo which has 2 fileds. I am trying to figure out how to write the property element in hibernate xml. I want these fields to be set using the sql function as follows: 1. AddDate: I want this field to be set using the sql function getdate() only on insert. 2. UpdateDate: ...

7. invalid sql generated when compound key contains 'id' field?    forum.hibernate.org

Hi, I've run into a situation where hibernate seems to generate invalid SQL if I have a property in a compound primary key named 'id'. Hopefully, someone can spot what I'm doing wrong here or confirm this is a bug. Description Below I have 2 pojos, A and B. A has a one to many relationship with B. Furthermore, B has ...

8. SQL generation for an AS/400 RRN field    forum.hibernate.org

Hi Everyone, I am having trouble getting hibernate to select a special RRN column from an AS/400 database. RRN is a relative record number that is handled internally by the AS/400. I need the RRN as part of a composite key as there is no primary key on the table. (table will never be changed or corrected) I do not know ...