Closed freewind closed 13 years ago
Well, not exactly. Setters work in both directions: when you assign a field value and when this value is read from database. Their main function is to convert a value to some common ground (which can't or shouldn't be expressed in backend as CHECK
constraint). So, long story short, setters should be idempotent. Maybe you should reconsider application logic to achieve your goals (e.g. check if a field was already encrypted before encrypting again, etc.).
Of course, here's how I would do that: http://github.com/inca/mystudy
ignore