This project is read-only.

Maintaining the order of column

Mar 17, 2010 at 9:00 AM

Dear nHydrate team,

    Firstly I would like to give my heart felt appreciation for providing a great tool to ease our lives. I just started using the tool a week back and have realized the amount of redundant code we don't have to write to maintain the abstraction layer. 


After using it for the first time I came to realize that the column names in model and also in the database are not maintained as per the order of creation but are sorted by the alphabet. I looked around and did not find any setting to maintain the order of creation of the columns. So, thought of giving a shout on the discussion board and see if I am missing something that is already available? If not, I would very much want to propose this as a requested feature for the future release. It is my personal opinion that maintaining the order of the column as per the creation helps in making the model be more readable than by having the columns sorted by alphabets.


Thanking you.




Mar 17, 2010 at 1:33 PM

You did not miss anything. There is no way to set this. First as you add to the fields to a model with an existing database the fields will be appended to their table. However when you create a table the field order could be preserved I guess. This has never been an issue so far but we will consider it. Please let me know why this is useful. Really the whole point of creating nHydrate was so you never go to or look at your database. Of course that is not reality but that was the goal.

Mar 17, 2010 at 1:49 PM

Hi CT,

    Thank you for the reply. 

Yes, I do agree it is not a big issue. But it is helpful when documenting and collaborating with the client and teammates. For example, when you try explaining the model to your fellow teammates or clients (tech savvy ones), it would help if we have the columns in the order of creation (or rather in the order we want it to be placed) so that related columns come one after another. 


For example, lets take a sample table called "ENTITY" which I created, the columns in that table would be:

entity_id (PK)



entity_address and so on...


If you look at the above explanation I display "entity_id" at the start of the list for the reason it is the primary key and thats where the discussion about this model starts off. Then logically speaking we proceed with the name, email id, address, telephone number and so on

But when we add this model to nHydrate it puts the column as



entity_id ... and so on


It would be hard to do a cross check of a paper / notepad written model towards a nHydrate model because the columns are not in the order that we would like them to be.


As I agreed, this is not critical as in a functional sort of way, but when it comes down to collaboration it makes sense.


Thanking you.