Re: [Modeling-users] three little questions
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-12-05 11:11:46
|
Mario Ruggier <ma...@ru...> wrote: > two small questions that I do not remember/find the answer for... > Can anyone remind me: > - how to best incorporate a constraint that a (non-primary, string) > attribute value should be unique ? Well, there's no way to tell the framework to enforce that, my suggestion would be to alter the db-schema to tell the database about this, e.g.:: ALTER TABLE BOOK ADD CONSTRAINT unique_book_title UNIQUE(TITLE); Note that we can maybe consider adding a 'unique' property to attributes, but then, this won't be enforced by the framework itself (because validation would require fetching all values such a field and comparing) but by the database. But at least the generated db schema could take this into account, and errors would be appropriately raised at commit time by the database. If you really feel like you need this, please fill in a RFE. > - how to best handle enumeration attributes ? I'd say, add your own validation logic for the attribute and/or check for valid values in setters. > - how to best handle the single quote character when writing out > string values ? (unescaped gives error for sqlite) Hmm, strange, I need to check that. This is a bug, I do not know whether this affects other adaptors as well --in any case you can fill in a bug report for this one, thanks for reporting. -- S=E9bastien. |