[Hibernate-JIRA] Created: (HHH-3578) Add setReadOnly(true) method to the Criteria interface
by Graeme Rocher (JIRA)
Add setReadOnly(true) method to the Criteria interface
------------------------------------------------------
Key: HHH-3578
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3578
Project: Hibernate Core
Issue Type: New Feature
Components: core
Affects Versions: 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.6, 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final, 3.0 rc 1, 3.0 beta 4, 3.0 beta 3, 3.0 beta 2, 3.0 beta 1, 3.0 alpha
Reporter: Graeme Rocher
Currently the Query interface has a setReadOnly(true) method but the Criteria interface does not, this makes it impractical to use the Criteria API for read-only queries.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[Hibernate-JIRA] Created: (HBX-936) Project cannot be deleted when there is console configuration associated with the project
by Dariusz Tylus (JIRA)
Project cannot be deleted when there is console configuration associated with the project
-----------------------------------------------------------------------------------------
Key: HBX-936
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-936
Project: Hibernate Tools
Issue Type: Bug
Components: consoleconfiguration, eclipse
Affects Versions: 3.2beta9
Environment: Eclipse 3.2, Windows XP, jdk1.5.0_8
Reporter: Dariusz Tylus
Project cannot be deleted when there is console configuration associated with the project:
Use case:
1. Create java project
2. Put jdbc driver jar file into lib filder (in the project)
3. Create console configuration for this project
4. Swich to the hibernate perspective and expand the tree for just created console configuration
5. Delete the console configuration
6. Delete the project and select option 'Also delete contents under....'
There is following error:
==
Problems encountered while deleting resources.
Could not delete: /hbmtest.
Problems encountered while deleting resources.
Problems encountered while deleting files.
Could not delete: C:\work\ORM\_tests\orm\hbmtest\lib\hsqldb-1_7_2_9.jar.
Could not delete: C:\work\ORM\_tests\orm\hbmtest\lib.
==
The problem is that jvm keeps lock on the jar file so it cannot be deleted.
Console configuration also keeps reference to the driver class.
Could the console configuration release all resources when it is deleted?
Thenx,
Dariusz
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[Hibernate-JIRA] Created: (EJB-272) PostRemove being called before entity is actually deleted
by Paul (JIRA)
PostRemove being called before entity is actually deleted
---------------------------------------------------------
Key: EJB-272
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-272
Project: Hibernate Entity Manager
Type: Bug
Versions: 3.2.1
Environment: Hibernate 3.2.1GA Entity Manager
Hibernate core 3.2.2 GA
Oracle 9i
Windows XP professional service pack 2
No application server is being used.
Reporter: Paul
I have an EntityListener with a method annotated with postremove. It seems that the method is being called before the actual entity is deleted from the database. When configuring log4j with "debug" logging it appears that the method is being called after the PreparedStatement is created and configured but before executeUpdate() is called.
I see the following statements in my log file before my listener is called
14:06:27,024 DEBUG AbstractBatcher:476 - preparing statement
14:06:27,024 DEBUG IntegerType:133 - binding '59532' to parameter: 1
My listener is called next. Then, the prepared statement is executed.
This violates the EJB3 spec. The EJB3 spec states "The PostPersist and PostRemove methods will be invoked after the
database insert and delete operations respectively."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years
[Hibernate-JIRA] Created: (HHH-3224) Invalid generated SQL for nested queries
by Adam Dyga (JIRA)
Invalid generated SQL for nested queries
----------------------------------------
Key: HHH-3224
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3224
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: MySQL
Reporter: Adam Dyga
I'm facing a problem with invalid generated SQL for nested queries.
I've the following class hierarchy (left only the most important fields for clarity):
//base class
class Asset {
String description; // <- field in base class
}
class ImageSet {
List<Wallpaper> wallpapers;
}
class Wallpaper extends Asset { // <- inherits from Asset
}
The HBM mappings:
<class name="com.company.Asset" table="Asset" abstract="true">
<property name="description" column="description" type="string" />
<id>...</id>
</class>
<class name="ImageSet" table="ImageSets">
<bag name="wallpapers" cascade="delete-orphan" inverse="true"
table="Wallpapers">
<key column="imageSetId" />
<one-to-many class="com.company.Wallpaper" />
</bag>
</class>
<joined-subclass name="com.company.Wallpaper"
extends="com.company.Asset" table="Wallpapers">
<key column="id" />
<many-to-one name="imageSet" column="imageSetId"
class="com.company.ImageSet" />
</joined-subclass>
When I try to execute the following HQL query:
select distinct imageSet from ImageSet imageSet where (select count(*) from imageSet.wallpapers w where w.description is not null) = size(imageSet.wallpapers)
I get the following SQL query:
select distinct imageset0_.id as id14_ from ImageSets imageset0_ where (select count(*) from Wallpapers wallpapers1_ where imageset0_.id=wallpapers1_.imageSetId and (wallpapers1_1_.description is not null)])=(select count(wallpapers2_.imageSetId) from Wallpapers wallpapers2_ inner join Asset wallpapers2_1_ on wallpapers2_.id=wallpapers2_1_.id where imageset0_.id=wallpapers2_.imageSetId)
The error message is
Unknown column 'wallpapers1_1_.description' in 'where clause'
which is right - note the missing wallpapers1_1_ alias which should be defined during inner join of the Wallpapers table with the base Asset table in the first nested query - just as it is done in the second nested query.
Full stack trace of any exception that occurs:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2216)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'wallpapers1_1_.description' in 'where clause'
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HSEARCH-306) Problem with composite key
by Mohit Khopkar (JIRA)
Problem with composite key
--------------------------
Key: HSEARCH-306
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-306
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.1.0.CR1
Reporter: Mohit Khopkar
Attachments: hibernate jira.zip
When a composite key is used and more than one results are expected , the values passed to the query are not in a proper expected order.
In the below query the parameters passed are (A00, A00),(A00, 1),(2,5) ....instead of the correct order which should be (A00,1) ,(A00,2), (A00,5)
(I have omitted the select part)..
..
where ((this_.key_client, this_.key_identifier) in ((?, ?), (?, ?), (?, ?)))
I tried to debug this issue and found that in the class org.hibernate.criterion.InExpression, the method getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) has 2 for loops , one for types and other for values. I get 2 types CustomType and LongType and so for each type it retrieves the value and adds it in the list in the order A00,A00,A00,1,2,5
I have attached the source code for your reference.
For more information, refer to the below topic on the hibernate forums:
http://forums.hibernate.org/viewtopic.php?t=992121&sid=16e54abb3dbc45d314...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-3164) "id in ..." with EmbeddedId and criteria API
by Bartosz Jablonski (JIRA)
"id in ..." with EmbeddedId and criteria API
--------------------------------------------
Key: HHH-3164
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3164
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.6
Environment: hibrenate 3.2.5 hibernate-annotations 3.3.0, database - h2, postgresql, h2
Reporter: Bartosz Jablonski
Attachments: test.zip
This issue arised when I was debugging hibernate search, which wasn't retriving entities from query.
Problem is using query like 'entity.id in ...' with criteria api and embeddedId.
Let's say that we have classes:
@Entity
public class SomeEntity implements Serializable {
@Id
private SomeEntityId id;
(...)
}
@Embeddable
public class SomeEntityId implements Serializable {
private Integer id;
private Integer version;
(...)
}
In database there are rows:
(id,version)
1,11
1,12
10,21
10,22
10,23
Now I want to retrive rows with id (1,12) and (10,23) using Criteria API:
List ids = new ArrayList<SomeEntityId>(2);
ids.add( new SomeEntityId(1,12) );
ids.add( new SomeEntityId(10,23) );
Criteria criteria = session.createCriteria( SomeEntity.class );
Disjunction disjunction = Restrictions.disjunction();
disjunction.add( Restrictions.in( "id", ids ) );
criteria.add( Restrictions.in( "id", ids ) );
hibernate returns no rows, because it constructs query like this:
select this_.id as id0_0_, this_.version as version0_0_, this_.prop as prop0_0_ from SomeEntity this_ where (this_.id, this_.version) in ((1, 10), (12, 23))
instead of
select * from SomeEntity where (id, version) in ((1, 12), (10, 23))
As example I attached maven project which is using h2 database - just run class test.App
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-2142) PersistentMap.put(), remove() may return UNKNOWN object that can cause ClassCastException in client code
by Andrzej Miazga (JIRA)
PersistentMap.put(), remove() may return UNKNOWN object that can cause ClassCastException in client code
--------------------------------------------------------------------------------------------------------
Key: HHH-2142
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2142
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr5
Reporter: Andrzej Miazga
Here is some code in Hibernate 3.2.0cr5 that may cause this behaviour. I'm not sure if this is a bug but it surely affects the client code.
AbstractPersistentCollection:
protected Object readElementByIndex(Object index) {
if (!initialized) {
...
return persister.getElementByIndex( entry.getLoadedKey(), index, session, owner );
}
...
return UNKNOWN;
}
PersistentMap (extends AbstractPersistentCollection):
public Object put(Object key, Object value) {
if ( isPutQueueEnabled() ) {
Object old = readElementByIndex( key );
queueOperation( new Put( key, value, old ) );
return old;
}
...
So, there is a possibility to return UNKNOWN instance (MarkerObject) to the client code as the result of Map.put().
In version 3.1.3 this worked fine, but the implementation was different:
public Object put(Object key, Object value) {
Object old = isPutQueueEnabled() ?
readElementByIndex(key) : UNKNOWN;
if ( old==UNKNOWN ) {
write();
return map.put(key, value);
}
...
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 1 month