Do you guys consider max lengths business rules?

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 19-Feb-2005 02:02:55   

Just wondering if you guys consider max lengths in the database as business rules and implement these in the validator classes?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-Feb-2005 09:54:23   

All string lengths are already validated by LLBLGen Pro, you don't have to define these. So if you have a varchar field in the db of length 50, and you set the mapped entity field to a string of length 60, the validation will fail, and the field is not set.

Frans Bouma | Lead developer LLBLGen Pro
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 19-Feb-2005 15:39:59   

Otis wrote:

All string lengths are already validated by LLBLGen Pro, you don't have to define these. So if you have a varchar field in the db of length 50, and you set the mapped entity field to a string of length 60, the validation will fail, and the field is not set.

Well then, absolutely great! stuck_out_tongue_winking_eye