MyBatis mapping properties to database columns when inserting & updating (using annotations)?

I don't think so. I understand your concern, and I see how such a feature could be beneficial to you, especially early in development when POJO's tend to change so often.

I don't think so. I understand your concern, and I see how such a feature could be beneficial to you, especially early in development when POJO's tend to change so often. I don't think your objects fields will be refactored enough to justify the investment needed to provide this functionality.

I suggest you read about the @Param tag in the mybatis user guide. It's not exactly what your looking for here, but it is a way to decouple object field names to mybatis sql map variables.In my mind, I would take your approach over passing in individual feilds with a @Param. In regards to unit testing your sql maps, i'm fairly certain that if you use an ognl expression that doesn't have a corresponding get method in the object you'll get an exceptions.

I. E if you use #{someField}, and the object your passing in doesn't have a getSomeField() method, then you get exception.

I'm ok with less than ideal refactoring since, as you pointed out, it becomes a minor issue later in the development cycle. The part you mention about the unit testing is what I was most concerned about. Thank you very much for the reply.

– Ryan J Mar 24 at 1:28 Cool. It does throw a "NoSuchPropertyException", I ran into it today actually. – Andy Pryor Mar 24 at 3:21.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions