[Hibernate-JIRA] Created: (HHH-3402) Order.ignoreCase() doesn't work
by Weipeng Wang (JIRA)
Order.ignoreCase() doesn't work
--------------------------------
Key: HHH-3402
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3402
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.5
Environment: oracle10g
Reporter: Weipeng Wang
This is my My User.hbm.xml:
<class name="User"
table="USERS" schema="TEST" dynamic-insert="true"
dynamic-update="true" lazy="true">
<id name="id" type="long">......</id>
<property name="title" type="string">
<column name="TITLE" />
</property>
<property name="keyword" type="string">
<column name="KEYWORD" />
</property>
<component name="auditInfo"
class="AuditInfo">
<property name="auditStatus"
type="string">
<column name="AUDITSTATUS" />
</property>
<property name="auditTime" type="timestamp">
<column name="AUDITTIME" />
</property>
<many-to-one name="auditUser" column="AUDITMEMBER"
class="Member." lazy="proxy" />
</component>
... ... ...
</class>
AuditInfo.java is a value type, Member.java is another entity
my code fragment as follow:
....
DetachedCriteria detachedCrit = DetachedCriteria.forClass(persistentClass);
Example example = Example.create(exampleInstance);
detachedCrit.add(example) .addOrder(Order.asc("title").ignoreCase())
.addOrder(Order.asc("keyword").ignoreCase())
.addOrder(Order.asc("auditInfo.auditStatus").ignoreCase());
...
the sql on the console as follow :
select .... from
USERS this_,
...
where
...
order by
lower(this_.TITLE) asc,
lower(this_.KEYWORD) asc,
this_.AUDITSTATUS asc
all code run well except the last ignoreCase() !
--
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
17 years, 8 months
[Hibernate-JIRA] Created: (HHH-3090) Error when executing polymorphic queries with limits
by Jaime Porras (JIRA)
Error when executing polymorphic queries with limits
----------------------------------------------------
Key: HHH-3090
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3090
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5, any database
Reporter: Jaime Porras
Attachments: HQLQueryPlan.diff, test-polymorphic.tar.gz
When a polymorphic search is performed HQLQueryPlan.performList() never return any results because there is a mistake in this code:
for ( int x = 0; x < size; x++ ) {
final Object result = tmp.get( x );
if ( distinction.add( result ) ) {
continue;
}
includedCount++;
if ( includedCount < first ) {
continue;
}
combinedResults.add( result );
if ( max >= 0 && includedCount > max ) {
// break the outer loop !!!
break translator_loop;
}
}
The call to distinction.add( result ) returns true when the result is added and false when the result is already in the set. So the if code should be:
if ( !distinction.add( result ) ) {
continue;
}
--
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
17 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by vaibhavi (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
vaibhavi commented on HHH-1483:
-------------------------------
I had a same issue while fetching the records from the system table mysql.general_log..I am using 'MySQLDialect' as my hibernate.dialect property
and i could resolve this problem by writing the following statement in the dialect() constructor of Dialect class.
registerHibernateType( Types.LONGVARCHAR, Hibernate.TEXT.getName() );
> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
> Key: HHH-1483
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: MySQL 5.0.18-nt
> Reporter: Sergey Vladimirov
> Priority: Minor
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO | MUL | | |
> | answpos | int(11) | NO | | | |
> | answer | text | YES | | NULL | |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO | | 0 | |
> | answer | text | YES | | NULL | |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );
--
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
17 years, 8 months
[Hibernate-JIRA] Created: (HHH-3399) MapKey fails on foreign map key
by Luca Dall'Olio (JIRA)
MapKey fails on foreign map key
-------------------------------
Key: HHH-3399
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3399
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Environment: JBoss 4.2.2, EJB3
Reporter: Luca Dall'Olio
I have a "Master" Entity with a bidirectional (Many-To-One) relationship with a "Detail" Entity. "Detail" has a unidirectional relationship (One-To-Many) to a "Color" Entity
Here is the relevant mapping from the Master point of view, using a Map :
@javax.persistence.OneToMany(cascade = {javax.persistence.CascadeType.ALL} ,mappedBy = "master")
@javax.persistence.MapKey(name = "color")
public java.util.Map<java.lang.Long, Detail> getDetails()
{
return this.details;
}
The map key is on the "color" relationship (this should not be a MapKeyManyToMany since no additional column is needed on Master). Map key type is a java.lang.Long because of the Color identifier idColor.
After a (successful) create of these relationships, when a "merge" operation is called over Master, the following exception is thrown :
18:10:53,403 ERROR [BasicPropertyAccessor] IllegalArgumentException in class: Color, getter method of property: idColor
18:10:53,427 java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
at $Proxy209.update(Unknown Source)
... 57 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:183)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3596)
at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3312)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:181)
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:218)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
at org.hibernate.type.EntityType.replace(EntityType.java:253)
at org.hibernate.type.MapType.replaceElements(MapType.java:73)
at org.hibernate.type.CollectionType.replace(CollectionType.java:552)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:482)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:340)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:153)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:407)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:152)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:227)
at org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:188)
... 91 more
I have tried to follow the code at runtime, it looks like the Color identifier idColor is correctly recognized, but at a given point the java.lang.Long is treated like an Entity and the exception comes from the invoking getIdentifier() over the java.lang.Long instance!
Here, in my opinion, could be the wrong line in org.hibernate.type.MapType.replaceElements(...) :
Object key = cp.getIndexType().replace( me.getKey(), null, session, owner, copyCache );
me.getKey() passes the java.lang.Long identifier to the CollectionPersister, which treats it like an Entity causing the exception.
--
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
17 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1900) Prepared Statement closed before executed by AbstractBatcher - similar to HHH-876
by Nicolas Savois (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1900?page=c... ]
Nicolas Savois commented on HHH-1900:
-------------------------------------
I am facing the exact same problem,
i can't describe it better than what was previously said :
Failure occurs on a variety of queries, but only occasionally for any given query. Once the problem has occurred for a particular query (prepared statement), problem will occur every time from that point on for that query.
I am on different environments though,
hibernate 3.2.6 - spring 2.0.6 - dbcp 1.2.2 - Oracle 10g
partial stacktrace :
java.sql.SQLException: Closed Statement
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3519)
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3297)
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
org.hibernate.loader.Loader.doQuery(Loader.java:674)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3049)
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:399)
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:98)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836)
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
I've never been able to reproduce this out of my production environment, which is pretty annoying... I've been loading my development environment with JMeter (a lot !) but with no results...
any fix i missed?
> Prepared Statement closed before executed by AbstractBatcher - similar to HHH-876
> ---------------------------------------------------------------------------------
>
> Key: HHH-1900
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1900
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.3
> Environment: hibernate 3.1.3, MS SQL Server, Apache DBCP, JSQLConnect
> Reporter: Greg Burcher
> Priority: Critical
>
> Using Hibernate v3.1.3, I am experiencing symptoms that sound like bug HHH-876. Problem has been intermittent, may be related to timing/latency. Problem happens less frequently when lots of hibernate debug logging is turned on. Using JDBC drivers from jnetdirect, get com.jnetdirect.jsql.JSQLException with message of "The statement is closed".
> Failure occurs on a variety of queries, but only occasionally for any given query. Once the problem has occurred for a particular query (prepared statement), problem will occur every time from that point on for that query.
> Here is debug trace pattern of successful query:
> 10:05:40,099 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
> 10:05:40,099 DEBUG ConnectionManager:358 - opening JDBC connection
> 10:05:40,109 DEBUG DBCPConnectionProvider:? - active: 1 (max: 20) idle: 0(max: 20)
> Hibernate: select this_.id as id27_0_, this_.language as language27_0_, this_.enabled as enabled27_0_, this_.sourceID as sourceID27_0_, this_.focusQuestion as focusQue5_27_0_, this_.markedFocusQuestion as markedFo6_27_0_ from WebInquiryFocusQuestion this_ where this_.id=? and this_.enabled=? and this_.language=?
> 10:05:40,109 DEBUG AbstractBatcher:424 - preparing statement
> 10:05:40,109 DEBUG AbstractBatcher:327 - about to open ResultSet (open ResultSets: 0, globally: 0)
> 10:05:40,109 DEBUG AbstractBatcher:334 - about to close ResultSet (open ResultSets: 1, globally: 1)
> 10:05:40,109 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 10:05:40,109 DEBUG AbstractBatcher:470 - closing statement
> 10:05:40,119 DEBUG JDBCContext:213 - after autocommit
> 10:05:40,119 DEBUG ConnectionManager:341 - aggressively releasing JDBC connection
> 10:05:40,119 DEBUG ConnectionManager:378 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
> 10:05:40,119 DEBUG DBCPConnectionProvider:? - active: 0 (max: 20) idle: 1(max: 20)
> versus trace when error occurs:
> 10:05:41,481 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
> 10:05:41,481 DEBUG ConnectionManager:358 - opening JDBC connection
> 10:05:41,481 DEBUG DBCPConnectionProvider:? - active: 1 (max: 20) idle: 0(max: 20)
> Hibernate: select this_.id as id27_0_, this_.language as language27_0_, this_.enabled as enabled27_0_, this_.sourceID as sourceID27_0_, this_.focusQuestion as focusQue5_27_0_, this_.markedFocusQuestion as markedFo6_27_0_ from WebInquiryFocusQuestion this_ where this_.id=? and this_.enabled=? and this_.language=?
> 10:05:41,481 DEBUG AbstractBatcher:424 - preparing statement
> 10:05:41,481 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 10:05:41,481 DEBUG AbstractBatcher:470 - closing statement
> 10:05:41,501 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: null
> 10:05:41,501 ERROR JDBCExceptionReporter:72 - The statement is closed
> 10:05:41,511 DEBUG JDBCContext:213 - after autocommit
> 10:05:41,511 DEBUG ConnectionManager:341 - aggressively releasing JDBC connection
> 10:05:41,511 DEBUG ConnectionManager:378 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
> 10:05:41,511 DEBUG DBCPConnectionProvider:? - active: 0 (max: 20) idle: 1(max: 20)
> 10:05:41,511 DEBUG ConnectionManager:312 - connection already null in cleanup : no action
> Partial stack trace:
> [0] com.jnetdirect.jsql.JSQLException.makeFromDriverError:70 (in file JSQLException.java)
> [1] com.jnetdirect.jsql.JSQLStatement.setParam:1223 (in file JSQLStatement.java)
> [2] com.jnetdirect.jsql.JSQLPreparedStatement.setInt:693 (in file JSQLPreparedStatement.java)
> [3] org.apache.commons.dbcp.DelegatingPreparedStatement.setInt:116 (in file DelegatingPreparedStatement.java)
> [4] org.apache.commons.dbcp.DelegatingPreparedStatement.setInt:116 (in file DelegatingPreparedStatement.java)
> [5] org.hibernate.type.IntegerType.set:41 (in file IntegerType.java)
> [6] org.hibernate.type.NullableType.nullSafeSet:85 (in file NullableType.java)
> [7] org.hibernate.type.NullableType.nullSafeSet:63 (in file NullableType.java)
> [8] org.hibernate.loader.Loader.bindPositionalParameters:1514 (in file Loader.java)
> [9] org.hibernate.loader.Loader.prepareQueryStatement:1576 (in file Loader.java)
> [10] org.hibernate.loader.Loader.doQuery:661 (in file Loader.java)
> [11] org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections:224 (in file Loader.java)
> [12] org.hibernate.loader.Loader.doList:2145 (in file Loader.java)
> [13] org.hibernate.loader.Loader.listIgnoreQueryCache:2029 (in file Loader.java)
> [14] org.hibernate.loader.Loader.list:2024 (in file Loader.java)
> [15] org.hibernate.loader.criteria.CriteriaLoader.list:94 (in file CriteriaLoader.java)
> [16] org.hibernate.impl.SessionImpl.list:1552 (in file SessionImpl.java)
> [17] org.hibernate.impl.CriteriaImpl.list:283 (in file CriteriaImpl.java)
> [18] org.hibernate.impl.CriteriaImpl.uniqueResult:305 (in file CriteriaImpl.java)
> Stack trace will differ depending on which query triggers the problem.
--
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
17 years, 8 months
[Hibernate-JIRA] Commented: (HHH-16) Explicit joins on unrelated classes
by Sergey Pulyaev (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-16?page=com... ]
Sergey Pulyaev commented on HHH-16:
-----------------------------------
HQL part of this issue is done as i know - but is there any progress on Criteria API development?
I mean Criteria API for JOIN ON <expression> logic...
> Explicit joins on unrelated classes
> -----------------------------------
>
> Key: HHH-16
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-16
> Project: Hibernate3
> Issue Type: New Feature
> Components: core
> Affects Versions: antlr-rework
> Environment: Any
> Reporter: David Lloyd
> Assignee: Steve Ebersole
> Fix For: antlr-rework
>
>
> It would be nice to be able to do explicit joins on unrelated classes with HQL:
> (hope this renders correctly)
> select empl, phone
> from org.example.Employee empl
> left outer join org.example.PhoneBook phone
> on phone.lastName = empl.lastName
> and phone.firstName = empl.firstName
> where empl.salaryGrade > 10
> Note that this would also implicity solve HB-1089 because you could list join criteria that match what Hibernate would have chosen anyway (i.e., list a many-to-one relationship as a criteria explicitly).
> Syntactically this could be disambiguated from the existing join syntax because the token after "join" is a class name rather than a property name.
--
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
17 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1936) IdentityGenerator doesn't support BigInteger as a valid identity type.
by Guenther Enthaler (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1936?page=c... ]
Guenther Enthaler commented on HHH-1936:
----------------------------------------
I tried extending IdentityGenerator to get around all this, and then came up against HBX-910.
> IdentityGenerator doesn't support BigInteger as a valid identity type.
> ----------------------------------------------------------------------
>
> Key: HHH-1936
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1936
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5
> Environment: Hibernate 3.0.5, Sybase 12.05, Window/ Unix
> Reporter: Leonid Shtivelman
>
> Identity generator strategy doesn't support BigInteger as a valid id type. This causes problem with Sybase which requires identity column to be numeric. It would seem an obvious way to get around this problem is to set column mapping to long in hibernate xml and the actual java object. This will solve obvious problem of creating identity, but will cause performance problem on selection. In order for Sybase to use index for parameter query the variable type of the parameter and column index type has to be the same. If ones maps column type to Long, Hibernate will use JDBC method setLong(long) to set value in the prepared statement. This will cause mismatch between parameter type and column index type, and Sybase will not use index to locate index. As you can see this is a big problem for anyone that is using identity columns Sybase and Hibernate
--
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
17 years, 8 months
[Hibernate-JIRA] Created: (HBX-910) hbm2ddl doesn't create identity column with custom identifier generator
by Luca Dall'Olio (JIRA)
hbm2ddl doesn't create identity column with custom identifier generator
-----------------------------------------------------------------------
Key: HBX-910
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-910
Project: Hibernate Tools
Type: Bug
Environment: hibernate 3.2.1 hsqldb 8.0.1
Reporter: Luca Dall'Olio
Priority: Minor
When defining a custom identifiergenerator which implements org.hibernate.id.PostInsertIdentifierGenerator ,
hbm2ddl doesn't define the primary key column as identity (i.e. hibernate.hbm2ddl.auto=create)
By looking at the source code, the hbm2dll depends on org.hibernate.mapping.SimpleValue.isIdentityColumn() function, which in turn has a direct dependency on IdentityGenerator.class :
public boolean isIdentityColumn(Dialect dialect) {
return IdentifierGeneratorFactory.getIdentifierGeneratorClass(identifierGeneratorStrategy, dialect)
.equals(IdentityGenerator.class);
}
in my opinion, it should depend instead on the PostInsertIdentifierGenerator interface :
public boolean isIdentityColumn(Dialect dialect) {
return IdentifierGeneratorFactory.getIdentifierGeneratorClass(identifierGeneratorStrategy, dialect)
.isInstance(PostInsertIdentifierGenerator.class);
}
Here is an example of a custom IdentityGenerator which can reproduce this problem :
package sample;
...
public class CustomIdentifierGenerator implements IdentifierGenerator, PostInsertIdentifierGenerator {
private static IdentityGenerator hibernateGeneratorDelegate = null;
public Serializable generate(SessionImplementor session, Object object)
throws HibernateException {
return hibernateGeneratorDelegate.generate(session, object);
}
public InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(
PostInsertIdentityPersister persister, Dialect dialect,
boolean isUseGet) throws HibernateException {
return hibernateGeneratorDelegate.getInsertGeneratedIdentifierDelegate(persister, dialect, isUseGet);
}
}
Here an example mapping fragment :
<id name="id" type="long" column="DMM_ID">
<generator
class="sample.CustomIdentifierGenerator " />
</id>
--
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
17 years, 8 months