You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Al Lofus (JIRA)" <ji...@apache.org> on 2005/10/19 02:36:44 UTC

[jira] Created: (OJB-75) orderby attribute in repository_user.xml not always respected

orderby attribute in repository_user.xml not always respected
-------------------------------------------------------------

         Key: OJB-75
         URL: http://issues.apache.org/jira/browse/OJB-75
     Project: OJB
        Type: Bug
  Components: PB-API  
    Versions: 1.0.3    
 Environment: All
    Reporter: Al Lofus


We have an object mapping defined that contains a collection-descriptor. That collection-descriptor uses an orderby attribute and an indirection table, as follows:

<class-descriptor class="com.dchoc.common.entity.LeagueEntity" table="LEAGUES">
    <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
    <field-descriptor id="2" name="name" column="NAME" jdbc-type="VARCHAR"/>
    <collection-descriptor
     name="members"
     auto-retrieve="true"
     auto-update="object"
     auto-delete="object"
     proxy="true"
     indirection-table="LEAGUE_MEMBERS"
     orderby="leagueSequence"
     element-class-ref="com.dchoc.common.entity.LeagueAccountEntity">
	<fk-pointing-to-this-class column="LEAGUE_ID"/>
     	<fk-pointing-to-element-class column="LEAGUE_ACCOUNT_ID"/>
    </collection-descriptor>
</class-descriptor>

We were having problems where sometimes the objects returned in the members collection were ordered by the leagueSequence, and sometimes they weren't. From our testing, we determined that the objects in the members collection were ordered by leagueSequence when the LeagueEntity objects were obtained via a call to PersistenceBroker.getObjectByQuery(Query). When the LeagueEntity objects were obtained via a call to PersistenceBroker.getCollectionByQuery(Query), the objects in the members collection were *not* ordered by leagueSequence (they were ordered by a default order of ID/primary key). We turned on the SQL generation for OJB and verified that in the former case, the SQL select statement includes an order by clause, and in the latter case, it does not.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Resolved: (OJB-75) orderby attribute in repository_user.xml not always respected

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-75?page=all ]
     
Jakob Braeuchi resolved OJB-75:
-------------------------------

    Fix Version: 1.0.x CVS
                 1.1 CVS
     Resolution: Fixed

> orderby attribute in repository_user.xml not always respected
> -------------------------------------------------------------
>
>          Key: OJB-75
>          URL: http://issues.apache.org/jira/browse/OJB-75
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.3
>  Environment: All
>     Reporter: Al Lofus
>     Assignee: Jakob Braeuchi
>      Fix For: 1.1 CVS, 1.0.x CVS

>
> We have an object mapping defined that contains a collection-descriptor. That collection-descriptor uses an orderby attribute and an indirection table, as follows:
> <class-descriptor class="com.dchoc.common.entity.LeagueEntity" table="LEAGUES">
>     <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
>     <field-descriptor id="2" name="name" column="NAME" jdbc-type="VARCHAR"/>
>     <collection-descriptor
>      name="members"
>      auto-retrieve="true"
>      auto-update="object"
>      auto-delete="object"
>      proxy="true"
>      indirection-table="LEAGUE_MEMBERS"
>      orderby="leagueSequence"
>      element-class-ref="com.dchoc.common.entity.LeagueAccountEntity">
> 	<fk-pointing-to-this-class column="LEAGUE_ID"/>
>      	<fk-pointing-to-element-class column="LEAGUE_ACCOUNT_ID"/>
>     </collection-descriptor>
> </class-descriptor>
> We were having problems where sometimes the objects returned in the members collection were ordered by the leagueSequence, and sometimes they weren't. From our testing, we determined that the objects in the members collection were ordered by leagueSequence when the LeagueEntity objects were obtained via a call to PersistenceBroker.getObjectByQuery(Query). When the LeagueEntity objects were obtained via a call to PersistenceBroker.getCollectionByQuery(Query), the objects in the members collection were *not* ordered by leagueSequence (they were ordered by a default order of ID/primary key). We turned on the SQL generation for OJB and verified that in the former case, the SQL select statement includes an order by clause, and in the latter case, it does not.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Commented: (OJB-75) orderby attribute in repository_user.xml not always respected

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OJB-75?page=comments#action_12357526 ] 

Jakob Braeuchi commented on OJB-75:
-----------------------------------

could you please post the sqls. 
i expect a prefetching problem here.

> orderby attribute in repository_user.xml not always respected
> -------------------------------------------------------------
>
>          Key: OJB-75
>          URL: http://issues.apache.org/jira/browse/OJB-75
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.3
>  Environment: All
>     Reporter: Al Lofus

>
> We have an object mapping defined that contains a collection-descriptor. That collection-descriptor uses an orderby attribute and an indirection table, as follows:
> <class-descriptor class="com.dchoc.common.entity.LeagueEntity" table="LEAGUES">
>     <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
>     <field-descriptor id="2" name="name" column="NAME" jdbc-type="VARCHAR"/>
>     <collection-descriptor
>      name="members"
>      auto-retrieve="true"
>      auto-update="object"
>      auto-delete="object"
>      proxy="true"
>      indirection-table="LEAGUE_MEMBERS"
>      orderby="leagueSequence"
>      element-class-ref="com.dchoc.common.entity.LeagueAccountEntity">
> 	<fk-pointing-to-this-class column="LEAGUE_ID"/>
>      	<fk-pointing-to-element-class column="LEAGUE_ACCOUNT_ID"/>
>     </collection-descriptor>
> </class-descriptor>
> We were having problems where sometimes the objects returned in the members collection were ordered by the leagueSequence, and sometimes they weren't. From our testing, we determined that the objects in the members collection were ordered by leagueSequence when the LeagueEntity objects were obtained via a call to PersistenceBroker.getObjectByQuery(Query). When the LeagueEntity objects were obtained via a call to PersistenceBroker.getCollectionByQuery(Query), the objects in the members collection were *not* ordered by leagueSequence (they were ordered by a default order of ID/primary key). We turned on the SQL generation for OJB and verified that in the former case, the SQL select statement includes an order by clause, and in the latter case, it does not.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Assigned: (OJB-75) orderby attribute in repository_user.xml not always respected

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-75?page=all ]

Jakob Braeuchi reassigned OJB-75:
---------------------------------

    Assign To: Jakob Braeuchi

> orderby attribute in repository_user.xml not always respected
> -------------------------------------------------------------
>
>          Key: OJB-75
>          URL: http://issues.apache.org/jira/browse/OJB-75
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.3
>  Environment: All
>     Reporter: Al Lofus
>     Assignee: Jakob Braeuchi
>      Fix For: 1.1 CVS, 1.0.x CVS

>
> We have an object mapping defined that contains a collection-descriptor. That collection-descriptor uses an orderby attribute and an indirection table, as follows:
> <class-descriptor class="com.dchoc.common.entity.LeagueEntity" table="LEAGUES">
>     <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
>     <field-descriptor id="2" name="name" column="NAME" jdbc-type="VARCHAR"/>
>     <collection-descriptor
>      name="members"
>      auto-retrieve="true"
>      auto-update="object"
>      auto-delete="object"
>      proxy="true"
>      indirection-table="LEAGUE_MEMBERS"
>      orderby="leagueSequence"
>      element-class-ref="com.dchoc.common.entity.LeagueAccountEntity">
> 	<fk-pointing-to-this-class column="LEAGUE_ID"/>
>      	<fk-pointing-to-element-class column="LEAGUE_ACCOUNT_ID"/>
>     </collection-descriptor>
> </class-descriptor>
> We were having problems where sometimes the objects returned in the members collection were ordered by the leagueSequence, and sometimes they weren't. From our testing, we determined that the objects in the members collection were ordered by leagueSequence when the LeagueEntity objects were obtained via a call to PersistenceBroker.getObjectByQuery(Query). When the LeagueEntity objects were obtained via a call to PersistenceBroker.getCollectionByQuery(Query), the objects in the members collection were *not* ordered by leagueSequence (they were ordered by a default order of ID/primary key). We turned on the SQL generation for OJB and verified that in the former case, the SQL select statement includes an order by clause, and in the latter case, it does not.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org