Tagged Questions

1
vote
0answers
24 views

Hibernate cancelQuery and query logging

I'm trying to implement query timeout functionality with Hibernate 3.3.2 and so far have been unsuccessful going the backend code approach. Instead I've implemented a frontend solution to have a ...
1
vote
0answers
112 views

Using Hibernate CompositeUserType in JPA Queries

I am using a CompsiteUserType to map a class 'Unit': class Unit { long type; Currency currency; Currency crossCurrency; } where depending on the type of the Value ('Money', 'XRate', ...) the ...
1
vote
0answers
848 views

JPA Hibernate left join fetch generating mutiple queries

I have a jpql query to eagerly fetch multi level associations as follows select distinct s from Singer s left join fetch s.singerIdentifiers si //singerIdentifiers is collection in Singer object ...
1
vote
0answers
96 views

Dynamic queries in Hibernate keeps in memory

I use Hibernate in my app and I have this question: Queries are automatically generated by Hibernate, I use this code to retrieve objects from DB: Object result = session.get(clazz, id); where id ...
1
vote
0answers
163 views

unexpected sublist result returned by Hibernate query

I hava a HQL query as the following which returns a java.util.RandomAccessSubList of ORDER. The offset of the SubList is 1,so the first element of the query result list can't be accessed. SELECT ...
1
vote
0answers
192 views

Query on hibernate entity with user-type field

working with JPA above hibernate impl. I map my enums by using user-type follow the good practice to store a persistence key to the enum and not the ordinal (which can be changed). Now, i have a ...
0
votes
0answers
26 views

Is it possible to refer to entity itself in subquery filter?

I have to make Criteria for entity A, using subquery for entity B(having entity A as field). To avoid cache miss I have to reject id based queries. Thats pseudo code example DetachedCriteria ...
0
votes
0answers
17 views

How to fetch two objects with ManyToMany anotation

How can i fetch two collections Class Factory: @ManyToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) private List<Car> cars; @ManyToMany(fetch=FetchType.LAZY, cascade = ...
0
votes
0answers
41 views

Select query during transaction causes unsaved transient exception

Using EJB3 JPA with Spring/Hibernate and a Postgres database. I have a loop in which I am creating multiple instances of an Entity and persisting these using the EntityManager, within one (large) ...
0
votes
0answers
64 views

Grails: projection on embedded property of domain class

I have a Grails class called AuditingInfo, it is not mapped to any table in DB. class AuditingInfo { static constraints = { createdUser(nullable : true) updatedUser(nullable : ...
0
votes
0answers
57 views

Generate next number automatically in JtextField

I have a JFrame in eclipse for adding employee details.I need to display the next Employee Id in a textfield automatically when the add employee form is executed.Employee Id is set to autoincrement ...
0
votes
0answers
115 views

HQL “exists” generates invalid SQL

I'm using the following HQL to select a company only if it has employees: from Company as c where c.companyKey = :companyKey and exists (from Employee as e where e.companyKey = c.companyKey) In ...
0
votes
0answers
15 views

Mapping an aliased table relationship in Hibernate Annotations

I am trying to map a relationship in Hibernate that exists in the tables like so: PRODUCT table Product ID PRODUCTMASTERMAPPING Product ID Master Product ID Normally, in SQL world, I would write a ...
0
votes
0answers
226 views

Error while Querying : The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use

On trying to use a select query statement. The input variable has 8 characters just as expected. I dont know why this error comes for select query because for a select query it will query and if its ...
0
votes
0answers
60 views

Hibernate query with two OneToOne Relationship

@Entity @Table(name="con_usuario") public class Usuario implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; @Column(name = ...

1 2 3 4
15 30 50 per page