- Add identity column to all tables where there are composite keys.
- Create unique constraints for the composite keys - preserve uniqueness if this is a business requirement
- Try to create all the FK, and decide what to if/when there are missing stuff.
After you did this, you would have a far more reasonable schema, IMo
On 6/13/06, Craig Neuwirt <[EMAIL PROTECTED]
> wrote:
yeah, it is pretty unbelievable.
On 6/13/06, Ayende Rahien < [EMAIL PROTECTED]> wrote:No FK in the DB is something worrying, though. I had a database like this, and the result was that the FK ws not valid (missing parents, etc).
PK with negative values is funny, but not worrying.
Composite keys are a pain, though.But at least you have a PK.
Are you free to modify the schema? Are there other system that needs to _continue_ to work against the db?Possibly add columns if necessary.
On 6/13/06, Craig Neuwirt <[EMAIL PROTECTED] > wrote:This is my issue. The views will most definitely span multiple tables. The existing data model is so horrific, I can't describe it.- No surrogate PK, all business related- Tons of Composite PK (3-5 columns)- PKs with negative values to indicate business rule- No foreign keys to determine relationships (plain columns are used)....
On 6/13/06, G. Richard Bellamy < [EMAIL PROTECTED] > wrote:Craig,
As far as NH is concerned, it's a table. So, if the update or insert statement that NH creates would work in your favorite query analyzer, it'll work for NH.
The real trick comes when the view spans multiple tables, and does not include fields that must have values, and have no defaults, things like that…
- Richard
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Craig Neuwirt
Sent: Monday, June 12, 2006 12:07 PM
To: [email protected]
Subject: Re: [Castle-users] Using ActiveRecord with Legacy Database
I would like to use NHib on top of Views, but how will NHibernate work when the data needs to be inserted or updated?
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users
_______________________________________________ CastleProject-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/castleproject-users
