Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple named check constraints #2567

Open
peetw opened this issue Apr 1, 2016 · 3 comments
Open

Multiple named check constraints #2567

peetw opened this issue Apr 1, 2016 · 3 comments

Comments

@peetw
Copy link

peetw commented Apr 1, 2016

Currently it's possible to specify multiple check constraints for an entity by just joining each constraint together with "AND","OR", etc. and passing the concatenated string to mapping.CheckConstraint().

However, this results in a single check constraint in the database. For cases where there are multiple constraints it would be very useful to be able to specify them separately so that they appear as multiple check constraints within the database. This would make it much more obvious why an insert has failed as the check constraint would be much more specific.

Would this be something that can be easily implemented?

@hazzik
Copy link
Member

hazzik commented Sep 25, 2020

This is the area of the NHibernate.

@hazzik hazzik transferred this issue from nhibernate/fluent-nhibernate Sep 25, 2020
@peetw
Copy link
Author

peetw commented Sep 28, 2020

@hazzik so is this a limitation of NHibernate itself rather than FluentNHibernate then? Happy to have a quick look at this if you could point me in the right general direction 😄

@hazzik
Copy link
Member

hazzik commented Sep 29, 2020

Yes, it is limitation of NHibernate. Sorry, I misstyped "area" first time as "are" :-)

The NHibernate allows to specify only a single check for a column/class/etc.

<xs:attribute name="check" type="xs:string" />

<xs:attribute name="check" type="xs:string" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants