[Hibernate-JIRA] Created: (HHH-6925) Unnecessary .toLowercase() in SQLServer2005 dialect
by Hasan Ceylan (JIRA)
Unnecessary .toLowercase() in SQLServer2005 dialect
---------------------------------------------------
Key: HHH-6925
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6925
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Final
Environment: SQL Server with Turkish CI
Reporter: Hasan Ceylan
Priority: Blocker
in getLimitString(String, boolean), the original query is transformed to lower case. with non Turkish locale on the AS Server, this is lowered by latin rules.
However, SQL Server as its locale is Turkish, cannot match TURKISH_TABLE / TURKISH_COLUMN with turkish_table / turkish_column raising "object / column not found" exception.
For detailed info on how 'I / i' handled in Turkish locale please refer to http://www.java2s.com/Tutorial/CSharp/0440__I18N-Internationalization/tur...
Very simple fix is to remove the toLowerCase() from getLimitString(String, boolean). If that serves a purpose then lowering should be made based on SQL Server locale of the current user, connection, database (I am not sure).
Regards,
Hasan Ceylan
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6747) ClassCastException when rendering SimpleCaseExpression
by Anne Buit (JIRA)
ClassCastException when rendering SimpleCaseExpression
------------------------------------------------------
Key: HHH-6747
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6747
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.6.7
Environment: SQL Server 2005
Reporter: Anne Buit
Priority: Minor
Attachments: SimpleCase.zip
When creating a SimpleCase using CriteriaBuilder.selectCase(Expression<?> arg0), a classcast exception will be thrown when the query is rendered to a TypedQuery.
CriteriaQuery<Customer> query = builder.createQuery(Customer.class);
Root<Customer> root = query.from(Customer.class);
query.select(root);
SimpleCase<String, Integer> orderCase = builder.selectCase(root.get(Customer_.EMail));
orderCase = orderCase.when("test(a)test.com", 1);
orderCase = orderCase.when("test2(a)test.com", 2);
query.orderBy(builder.asc(orderCase.otherwise(0)));
em.createQuery(query);
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to org.hibernate.ejb.criteria.Renderable
at org.hibernate.ejb.criteria.expression.SimpleCaseExpression.render(SimpleCaseExpression.java:146)
at org.hibernate.ejb.criteria.CriteriaQueryImpl.render(CriteriaQueryImpl.java:346)
at org.hibernate.ejb.criteria.CriteriaQueryCompiler.compile(CriteriaQueryCompiler.java:223)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:441)
See attachement for a reproduction project.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-3129) Null Role in PersitentCollection during a onCollectionRecreate() in an Interceptor
by Jose CHILLAN (JIRA)
Null Role in PersitentCollection during a onCollectionRecreate() in an Interceptor
----------------------------------------------------------------------------------
Key: HHH-3129
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3129
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: Any
Reporter: Jose CHILLAN
When the "onCollectionRecreate" is invoked on an Interceptor, the getRole() method returns null. After investigation,
the problem is located in the class CollectionEntry in one of its constructors and is easily solved using the patch :
public CollectionEntry(CollectionPersister persister, PersistentCollection collection)
{
// new collections that get found + wrapped
// during flush shouldn't be ignored
ignore = false;
collection.clearDirty(); //a newly wrapped collection is NOT dirty (or we get unnecessary version updates)
snapshot = persister.isMutable() ? collection.getSnapshot(persister) : null;
// -- ADDED LINE HERE --
role = persister.getRole();
collection.setSnapshot(loadedKey, role, snapshot);
}
Thanks
--
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
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6580) Discriminator value used as ID when inserting entity to PosgtreSQL
by Paweł Stawicki (JIRA)
Discriminator value used as ID when inserting entity to PosgtreSQL
------------------------------------------------------------------
Key: HHH-6580
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6580
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.6, 3.6.5, 3.6.4, 3.6.3, 3.6.2, 3.6.1, 3.6.0
Environment: Tested on Hibernate 3.6.0, but I looked in the code of 3.6.6 and 4.0.0 Beta4 and it looks like it isn't fixed.
PostgreSQL 8.4.8
Reporter: Paweł Stawicki
When we have inheritance strategy SINGLE_TABLE, and we use discriminator column, this column is the first one in table. Now we want to insert some entity inheriting from this one, and we want PostgreSQL to automatically generate the ID for the new entity. Discriminator column is the first in the table.
Hibernate runs IdentityGenerator.GetGeneratedKeysDelegate.executeAndExtract(), which gets ResultSet from PreparedStatement (in Hibernate 3.6.0 it's line 97 in IdentityGenerator).
This ResultSet, in case of PostgreSQL, contains whole inserted row, not only ID. This is the problem if ID is not the first column, because then Hibernate get's value from the first column and uses it as ID. It's in IdentifierGeneratorHelper.getGeneratedIdentity() and IdentifierGeneratorHelper.get().
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-7099) Unable to build EntityManagerFactory with not-JTA Datasource
by Wilson Horstmeyer Bogado (JIRA)
Unable to build EntityManagerFactory with not-JTA Datasource
------------------------------------------------------------
Key: HHH-7099
URL: https://hibernate.onjira.com/browse/HHH-7099
Project: Hibernate ORM
Issue Type: Bug
Components: entity-manager
Affects Versions: 4.1.0, 4.0.1
Environment: Tomcat 7, Java 7, Hibernate 4.x, Servlet 3.0
Reporter: Wilson Horstmeyer Bogado
Attachments: HibernateTest.zip
When upgrading from Hibernate 3.6.x to Hibernate 4.x it is not possible to create an entity manager factory using a non-JTA Datasource in persistence.xml. When looking up the datasource with JNDI a "javax.naming.NamingException: This context must be accessed through a java: URL" exception is thrown. Debugging the source code we can see that in 3.6.x the lookup is done with "javax.naming.lookup(String)" but in 4.x it is done with "javax.naming.lookup(Name)" which fails.
The attached file is a test case. To reproduce, do the following:
1. Build the project with Maven
2. Deploy to Tomcat
3. Go to /hibernate-test/test
Result: All database records are shown in browser
Now, in pom.xml file, change hibernate.core.version property from 3.6.10.Final to 4.1.0.Final.
Repeat above steps.
Result: an exception stack trace is displayed which ends with:
Caused by: javax.naming.NamingException: This context must be accessed through a java: URL
at org.apache.naming.SelectorContext.parseName(SelectorContext.java:776)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:135)
at javax.naming.InitialContext.lookup(InitialContext.java:415)
at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65)
... 42 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months