Dashboard > RIFE > ... > Database > Ordinal manager
RIFE Log In | Sign Up   View a printable version of the current page.
Ordinal manager


Added by Geert Bevin, last edited by Geert Bevin on Nov 05, 2004  (view change)
Labels: 
(None)

The OrdinalManager class makes it possible to easily manage an integer ordinal column that is typically used to determine the order of the rows in a specific table.

The basic version manages the ordinals for the entire table, but it is also possible to create an OrdinalManager that uses several independent ranges of ordinals according to a restricting integer column.

For example, consider the following 'article' table:

id          INT
categoryId  INT
ordinal     INT
name        VARCHAR(30) 

with the following rows:

 id | categoryId | ordinal | name
----+------------+---------+-----------------------
  2 |          1 |       0 | some article
  0 |          1 |       1 | another one
  3 |          1 |       2 | boom boom 
  1 |          2 |       0 | this is yet an article
  5 |          2 |       1 | an article for you
  4 |          3 |       0 | our latest article
  6 |          3 |       1 | important one

You can clearly see three independent ordinal ranges according to the categoryId column.

The OrdinalManager allows you to easily change the order of the articles by moving them up and down. Additional methods are also available to perform a number of low-level operations. Take a look at the javadocs for more information.



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators