[Hibernate-JIRA] Created: (HHH-7111) Uppercase support for ILikeExpression.
by Sebastian (JIRA)
Uppercase support for ILikeExpression.
--------------------------------------
Key: HHH-7111
URL: https://hibernate.onjira.com/browse/HHH-7111
Project: Hibernate ORM
Issue Type: Improvement
Components: query-criteria
Reporter: Sebastian
If you want to do an ignore case like restriction (with ilike) the resulting SQL always uses the lower function.
That's unfortunate especially when an index on a column is uppercase and you want to make use of that index. It's also hard to convince DBAs to change their indexes because Hibernate doesn't support uppercase likes.
It would be nice to specify if upper() or lower() in ilike() should be used.
I know I can use upper() in HQL but than I would miss out all the advantages of the Criteria API.
Cheers,
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-7109) NPE in org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus
by Michael Nascimento Santos (JIRA)
NPE in org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus
------------------------------------------------------------------------------
Key: HHH-7109
URL: https://hibernate.onjira.com/browse/HHH-7109
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.0
Environment: hibernate-jpa-2.0-api:1.0.1-Final; hibernate-core:4.1.0.Final; hibernate-entitymanager:4.1.0.Final
Reporter: Michael Nascimento Santos
Priority: Minor
When using JPA with Hibernate as the persistence provider and a vanilla persistence.xml, the following exception is produced:
java.lang.NullPointerException
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73)
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115)
at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1208)
at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:177)
at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:89)
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:132)
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:127)
This is due to the fact the new, undocumented property, hibernate.transaction.jta.platform hasn't been set. However, since a NPE is thrown, the user has no way of figuring out what needs to be done to solve this.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-7102) Misleading error message is shown when no RegionFactory is manually set
by Michael Nascimento Santos (JIRA)
Misleading error message is shown when no RegionFactory is manually set
-----------------------------------------------------------------------
Key: HHH-7102
URL: https://hibernate.onjira.com/browse/HHH-7102
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.0
Environment: hibernate-jpa-2.0-api:1.0.1.Final; hibernate-core:4.1.0.Final; hibernate-entitymanager:4.1.0.Final
Reporter: Michael Nascimento Santos
Attachments: misleadingmessagewithnoregionfactoryset.zip
When an entity is marked as @Cacheable (and have @Cache on it, to work around HHH-7101), an exception will be thrown when calling Persistence.createEntityManagerFactory(String) informing the user that cache is not enabled and either hibernate.cache.use_second_level_cache or hibernate.cache.use_query_cache need to be set.
Although this is obviously very helpful, the exception will continue to be thrown with the same text even once both properties are set to true:
Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
at org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(NoCachingRegionFactory.java:69)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:347)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1740)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:88)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
... 11 more
At this point, the problem is Hibernate is using NoCachingRegionFactory instead of a valid one, but the message is completely deceiving and wastes user time. Instead, a clear message showing that a RegionFactory other than NoCachingRegionFactory should be set using hibernate.cache.region.factory_class should be produced instead.
Attached is a Maven-powered sample with Derby that can be executed with exec:java .
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-7105) Recursive one-to-many bi-directional association on subclass with discriminator generates incorrect DDL/SQL
by yojustinwalsh@gmail.com (JIRA)
Recursive one-to-many bi-directional association on subclass with discriminator generates incorrect DDL/SQL
-----------------------------------------------------------------------------------------------------------
Key: HHH-7105
URL: https://hibernate.onjira.com/browse/HHH-7105
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.0, 3.6.10
Environment: Tested on PostgreSQL 8.3
Reporter: yojustinwalsh(a)gmail.com
Attachments: subclass-joined-to-parent-with-set.zip
When an inverse one-to-many bi-directional relationship which references a subclass from a parent (abstract) class is mapped with a table-per-subclass strategy, the associated collection is always found to be empty.
The above mapping produces the following two anomalies which goes some way to explain why the associated collection is always empty:
1) An additional foreign key column is generated in the parent table (in the example, TBL_ABSTRACT_CONTAINER) and is never populated
2) The SQL that is generated selects the children based on the presence of this additional foreign key column (which is never populated). The SQL should be using the foreign key column in the child class (TBL_ITEM in the example)
The issue is discussed in detail on the hibernate forum: https://forum.hibernate.org/viewtopic.php?f=1&t=1014446
The attachment is a zipped eclipse/maven project which demonstrates the issue.
Simply unpack the archive, configure the database settings in hibernate-subclassjoinedtoparent.cfg.xml and
mvn test
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-6824) Hibernate query unexpectedly returns duplicate results
by Matthew Casperson (JIRA)
Hibernate query unexpectedly returns duplicate results
------------------------------------------------------
Key: HHH-6824
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6824
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.6.8
Environment: JBoss AS7, Seam 2.2.2
Reporter: Matthew Casperson
I have a situation where a query run through Hibernate is returning a single duplicate record, where the same query in SQL does not. The SQL query (formatted for readability) is:
select * from Topic where
(
(
exists (select 1 from TopicToTag where TopicToTag.TopicID = Topic.TopicID and TopicToTag.TagID = 119)
Or exists (select 1 from TopicToTag where TopicToTag.TopicID = Topic.TopicID and TopicToTag.TagID = 133)
Or exists (select 1 from TopicToTag where TopicToTag.TopicID = Topic.TopicID and TopicToTag.TagID = 132)
)
And
(
exists (select 1 from TopicToTag where TopicToTag.TopicID = Topic.TopicID and TopicToTag.TagID = 19)
And not exists (select 1 from TopicToTag where TopicToTag.TopicID = Topic.TopicID and TopicToTag.TagID = 14)
)
)
The Hibernate query is:
select topic from com.redhat.topicindex.entity.Topic as Topic where ((exists (select 1 from TopicToTag topicToTag where topicToTag.topic = topic and topicToTag.tag.tagId = 132) Or exists (select 1 from TopicToTag topicToTag where topicToTag.topic = topic and topicToTag.tag.tagId = 119) Or exists (select 1 from TopicToTag topicToTag where topicToTag.topic = topic and topicToTag.tag.tagId = 133) ) And (exists (select 1 from TopicToTag topicToTag where topicToTag.topic = topic and topicToTag.tag.tagId = 19) And not exists (select 1 from TopicToTag topicToTag where topicToTag.topic = topic and topicToTag.tag.tagId = 14) ))
The SQL query will return 474 records, while the Hibernate will return 475 entities with 1 duplicate.
The details of the tables are:
Table Topic
===========
TopicID, TopicTitle, TopicText, TopicAddedBy, TopicTimeStamp, TopicSVNURL, TopicXML
-----------
TopicID int(11) PK
TopicTitle varchar(512)
TopicText text
TopicAddedBy varchar(512)
TopicTimeStamp timestamp
TopicSVNURL varchar(512)
TopicXML text
Table TopicToTag
================
TopicToTagID, TopicID, TagID
----------------
TopicToTagID int(11) PK
TopicID int(11)
TagID int(11)
Table Tag
=========
TagID, TagName, TagDescription
---------
TagID int(11) PK
TagName varchar(512)
TagDescription text
The code for the entities can be viewed at:
https://sourceforge.net/p/topicindex/code/383/tree/trunk/src/main/com/red...
https://sourceforge.net/p/topicindex/code/383/tree/trunk/src/main/com/red...
https://sourceforge.net/p/topicindex/code/383/tree/trunk/src/main/com/red...
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-5429) [regression] unable to persist entity using derby 10.6.1.0 and hibernate 3.5+
by Max Giesbert (JIRA)
[regression] unable to persist entity using derby 10.6.1.0 and hibernate 3.5+
-----------------------------------------------------------------------------
Key: HHH-5429
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5429
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0.Beta1, 3.5.4, 3.5.3
Environment: derby 10.6.1.0 and hibernate 3.5+
Reporter: Max Giesbert
when inserting any kind of entity
@Entity
public class TestObject
{
private Long id;
private String test;
public TestObject(){}
@Id @GeneratedValue(strategy=GenerationType.AUTO)
public Long getId()
{
return id;
}
[...]
i get the following error message
org.hibernate.exception.ConstraintViolationException: could not insert: [com.mypackage.TestObject]
>>java.sql.SQLIntegrityConstraintViolationException: Column 'ID' cannot accept a NULL value.
>>org.apache.derby.impl.jdbc.EmbedSQLException: Column 'ID' cannot accept a NULL value.
>>ERROR 23502: Column 'ID' cannot accept a NULL value.
>> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
>> at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeColumn(Unknown Source)
>> at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeRow(Unknown Source)
>> at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
>> at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
>>...
the same code is working fine with versions 3.3.2GA and annotations 3.4.0GA and earlier. i just switched back...
--
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
14 years, 1 month