ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: ibator and default column value
Date Mon, 09 Nov 2009 17:32:19 GMT
The generated insertSelective method is intended to help with default
values in fields - you can use this method to keep columns out of the
insert list so that the default value is used.  I understand that this
does not help you with getting those values back into the domain
object - you'll have to do a select for that.  Selecting the values
from the DB is the only reliable way to get the values back in all
cases.

As for incremental updates to existing code...base Ibator will do this
for XML files, but not Java files.  The Eclipse plugin supplies this
function for Java files, so you'll need to wait until the new version
of the Eclipse plugin comes out for that.  This has been discussed on
this list many times, so you can look back in the archives to
understand the reasons for this.

I'm glad Ibator worked for you with iBATIS3!

Jeff Butler


2009/11/9 Tomáš Procházka <t.prochazka@centrum.cz>:
>
> Hi.
>
> I tested now new commit of ibator with iBatis support, it works great.
>
> I have only question. It's (or will be) possible generate also default value to class
fields, according to default value in DB? Some column has NULL, another 0 or true/false. If
new instance of domain class will be have default value it's easier to insert it in to table.
>
> And it's possible something like incremental update od generated code? If I add some
new column to DB table? If I own query or methods to generated code it will be lost during
next generate.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message