You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by "Becker, Joel" <jo...@essvote.com> on 2011/11/07 17:31:39 UTC

Database table column order

Is there a way to specify the order of database table column order? It
seems that the modeler always alphabetizes the db-attributes.

(I'm using modeler v 3.0.2)


RE: Database table column order

Posted by "Durchholz, Joachim" <Jo...@hennig-fahrzeugteile.de>.
It would be helpful if Modeler presented columns in the order they are defined in the database.
Because:
* More often than not, related columns are grouped together, particularly if they form multi-field foreign keys.
* Also, in tables with very many columns, it is easier to map database information to Modeler information if the orders are the same: even if finding the columns is easy from an alphabetically-sorted list, it is an additional step in some alrady pretty complicated mental exercizes.
* Finally, I find myself working more with database order than alphabetic order when working with Oracle in SQL Developer. Even though the ERP system we're using has its columns ordered alphabetically.

It would be even more helpful if Modeler offered a way to switch between database order and alphabetic order.
Because:
* Sometimes (rarely), I don't find the column even though I know the column structure.
For these situations, it would be perfect if when switching from alphabetic to database order, the currently selected column stayed selected and the list scrolled to it.

I know that's a set of wishlist items, and, as such, subject to developer time constraints :-)

Regards,
Jo

Re: Database table column order

Posted by Michael Gentry <mg...@masslight.net>.
Hi Joel,

Cayenne Modeler alphabetizes the column names for display, but
databases can order them however they want.  Usually it is the order
you add the columns.  Some databases, such as MySQL, allow you to
specify where to add columns, though.  However, this is kind of
outside of what Cayenne Modeler tries to do, which is model the
Java->DB mappings.

mrg

On Mon, Nov 7, 2011 at 11:31 AM, Becker, Joel <jo...@essvote.com> wrote:
> Is there a way to specify the order of database table column order? It
> seems that the modeler always alphabetizes the db-attributes.
>
> (I'm using modeler v 3.0.2)
>
>