This project has moved. For the latest updates, please go here.

Order of table defs matters?


Maybe this is an easy question, but I'm using Sterling in my phone project and I create new table defs as I develop and add more support for it.

Does the order in which you list the table definitions matter? I have two singleton settings models, DbSettings and LocalSettings, and at first I had LocalSettings defined first. Then a little later, I added the DbSettings definition above it.

Now Sterling throws an exception if I try to load the DbSettings saying it cannot cast LocalSettings to DbSettings.

Is this expected behavior? I didn't see order of table definitions mentioned in the docs. I assumed it did lookups based on the type of the table.


petermorlion wrote Mar 7, 2013 at 9:18 AM

I quickly wrote a unit test to test this, and it didn't fail. From what I see in the code, it shouldn't be a problem. I will test this further, but are you doing anything special with te types DbSettings and LocalSettings (inheritance?)? Which version of SterlingDB are you using?