On Sunday, November 4, 2012 5:58:50 PM UTC+1, Lukas Eder wrote:
>
>
>
> Adam's JIRM goes a little farther and uses Jackson annotations, such as 
> these: 
>
>     @JsonCreator 
>     public TestBean( 
>             @JsonProperty("stringProp") String stringProp, 
>             @JsonProperty("longProp") long longProp, 
>             @JsonProperty("timeTS") Calendar timeTS ) { 
>
>
Yes but the java object that will be used as parameter to that 
SQL-with-placeholder insert query he mentionned, I guess you will have to 
populate it with some values before feeding it to the query.
And if it's immutable, you'll have no other ways than using constructors to 
specify all the values which tends to become error-prone as parameter lists 
grow. There's often no more than 3 or 4 different value types in a table, 
so it may be easy to switch order. 

Perhaps this immutability problem could be solved by the mean of interfaces 
rather than final fields,
You insert : you create the object, you can use accessor, you select : you 
receive an interface that has no mutators...  just an idea as that's 
probably not the goal...
 

Reply via email to