[Hibernate-JIRA] Commented: (HHH-759) problem for mixxing setmaxresults and setlockmode
by areis (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-759?page=co... ]
areis commented on HHH-759:
---------------------------
I am facing the same problem as reported by Frederic Leitenberger (I also need to use ORDER BY, MAXROWS and FOR UPDATE in one query. ) .
Is there an estimate of when there will be a solution?
Thanks!
> problem for mixxing setmaxresults and setlockmode
> -------------------------------------------------
>
> Key: HHH-759
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-759
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.0.2
> Environment: Client:windows2000 professional,jre1.4.2, oracle8client,eclipse3.1-RC3,hibernate-tools 3.0 alpha4a,JBossIDE1.5M1
> Server:Solaris 2.8, oracle 8.1.7
> Reporter: johnhua
> Priority: Minor
>
> there is a problem for mixxing setmaxresults and setlockmode.
> the problem is that "ORA-00904: invalid column name".
> The error info is as the below:
> Hibernate: select * from ( select idmapp0_.RI as col_0_0_ from PCTMNGT.IDMAP_P idmapp0_ where idmapp0_.STATUS=? ) where rownum <= ? for update of idmapp0_.RI
> 14:21:54,076 DEBUG AbstractBatcher:AbstractBatcher.java:365 - preparing statement
> 14:21:54,082 DEBUG AbstractBatcher:AbstractBatcher.java:285 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 14:21:54,083 DEBUG AbstractBatcher:AbstractBatcher.java:403 - closing statement
> 14:21:54,090 WARN JDBCExceptionReporter:JDBCExceptionReporter.java:71 - SQL Error: 904, SQLState: 42000
> 14:21:54,091 ERROR JDBCExceptionReporter:JDBCExceptionReporter.java:72 - ORA-00904: invalid column name
> The source code is as the below:
> //query an unused emid for new tone
> query = av_session.createQuery("select v_idmap from IdmapP as v_idmap where v_idmap.status=:v_status");
> query.setCharacter("v_status",EMID_STATUS.UNUSED.charValue());
> query.setMaxResults(1);
> query.setLockMode("v_idmap",LockMode.UPGRADE);
> it = query.iterate();
> if( !it.hasNext() )
> {
> tx.rollback();
> lv_err = "addRing::doAddRingFile: no unused EMID for new tone in idmap. toneid="+av_tone;
> throw new InterfaceErrException(lv_err,INTERFACE_RETCODE.SYSTEM_ERR);
> }
--
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
16 years
[Hibernate-JIRA] Created: (HHH-3667) Problem in class Dialect
by Jorge Miguel da Silva e Sá (JIRA)
Problem in class Dialect
------------------------
Key: HHH-3667
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3667
Project: Hibernate Core
Issue Type: Bug
Components: core
Reporter: Jorge Miguel da Silva e Sá
I have a problem with Hibernate. When I add one foreignKey Constraint in one table my application hang.
When i debug the problem, I think I found a bug in this feature ( getAddForeignKeyConstraintString).
When it does
if ( !referencesPrimaryKey )
Not should not be
if ( referencesPrimaryKey ) ?
public String getAddForeignKeyConstraintString(
String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey,
boolean referencesPrimaryKey) {
StringBuffer res = new StringBuffer( 30 );
res.append( " add constraint " )
.append( constraintName )
.append( " foreign key (" )
.append( StringHelper.join( ", ", foreignKey ) )
.append( ") references " )
.append( referencedTable );
if ( !referencesPrimaryKey ) {
res.append( " (" )
.append( StringHelper.join( ", ", primaryKey ) )
.append( ')' );
}
return res.toString();
}
--
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
16 years
[Hibernate-JIRA] Created: (HHH-2629) Enable ordering by association paths
by Jörg Heinicke (JIRA)
Enable ordering by association paths
------------------------------------
Key: HHH-2629
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2629
Project: Hibernate3
Issue Type: Patch
Components: query-criteria
Affects Versions: 3.2.4.sp1
Reporter: Jörg Heinicke
In Hibernate's criteria API ordering is not possible on association properties without explicitly creating aliases.
This also only works on one level, not recursively as it would be needed in the following example.
Criteria criteria = session.createCriteria(Account.class);
Criteria pCriteria = criteria.createCriteria("person");
pCriteria.add(Example.create(person));
pCriteria.createCriteria("company");
criteria.addOrder(Order.asc("person.company.name"));
return criteria.list();
I have changed CriteriaQueryTranslator in a way that it first searches the aliasCriteriaMap, second the associationPathCriteriaMap. And the key used for the search is no longer
StringHelper.root( propertyName );
but
StringHelper.qualifier( propertyName );
>From what I understand this can't break anything since it has always only worked with one '.' in the path. For those cases the key stays the same.
This implementation is still not perfect since
1. you need to create criteria in advance
2. you can't switch between alias and actual association path. The best would probably be to walk the path recursively.
--
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
16 years