On 11/14/05, Larry Meadors <[EMAIL PROTECTED]> wrote:
> Uhm, use a database default?
Maybe. Don't all databases error on setting a non-nullable, defaulted
column to null? (as opposed to not setting it at all).
We use MySQL with both SQLMap and DAO. We are configured to use Apache's DBCP data source. All transactions are automatic except for 2 where we needed to explicitly startTransaction()/commitTransaction/endTransaction(). The endTransaction() is always in a finally block, and we verified we are
Just throwing in something I've seen before... A former co-worker of mine
made a pretty elaborate solution to the problem of loading object graphs of
arbitrary depth... (A contact that has an address, that has a city, that has
a ...)
She created metadata that were essentially constants shared bet
Yep, this is the way we initially had done it but my afilliate does not
prefer it that way.
However this is solved.
Closed.
Thanks,
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, November 14, 2005 3:06 PM
To: user-java@ibatis.apache.org
Subject: Re:
Well the best bet now would be to initialize the java bean with a
default value, i.e. -1.
On Nov 14, 2005, at 12:56 PM, Jason Hall wrote:
Okay,
Just wanted to know, an afilliate of mine wanted to know.
Thanks,
JH.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE
Okay,
Just wanted to know, an afilliate of mine wanted to know.
Thanks,
JH.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Larry Meadors
Sent: Monday, November 14, 2005 2:53 PM
To: user-java@ibatis.apache.org
Subject: Re: Inserting Default values if o
On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote:
>
> maybe ibatis should support this.
I disagree.
IMO this is something that should live inthe service/ business logic
layer (if it is an application rule), or in the database (if it is an
enterprise rule).
Putting it in iBATIS (an itegration po
maybe ibatis should support this.
From: Niels Beekman [mailto:[EMAIL PROTECTED]
Sent: Monday, November 14, 2005 2:34 PMTo:
user-java@ibatis.apache.orgSubject: RE: Inserting Default values if
object member is null
You are right, you
can’t, because there is no need, since the database supp
I've tried doing it inline and i still get the database
error, cannot insert null value.
I'm trying to insert -1
and not a null value because the database column is set to not
null.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Sent: Monday, November 14, 2005 2:29
PMTo: user-java@iba
You are right, you can’t, because there
is no need, since the database supports this natively.
Niels
From: Jason Hall
[mailto:[EMAIL PROTECTED]
Sent: maandag 14 november 2005
20:33
To: user-java@ibatis.apache.org
Subject: RE: Inserting Default
values if object member is nul
I don't want to insert null in the database, i want to
insert -1 because the database column is set to not null.
Maybe Ibatis does not support this.
From: Niels Beekman [mailto:[EMAIL PROTECTED]
Sent: Monday, November 14, 2005 2:28 PMTo:
user-java@ibatis.apache.orgSubject: RE: Inserting Def
You should use the DTD (http://ibatis.apache.org/dtd/sql-map-2.dtd).
The property is actually nullValue, in your example:
When iBATIS finds -999 in the Dummy.id-property
it will insert null into the database, when null is found in the database,
iBATIS will put -999 in the Dummy.id-prope
BTW you could also do it inlineinsert into A (col1,col2) values (#col1:NUMERIC:-1#, #col2:VARCHAR:NO_ENTRY#This can be found on page 20 of the developers guideOn Nov 14, 2005, at 12:09 PM, Jason Hall wrote: Yah, but the db column is set to not null, so you would get a database error. I've tried th
I tried using null property and i get and sqlmapconfig
parsing error - "null" not a valid property.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Sent: Monday, November 14, 2005 2:24
PMTo: user-java@ibatis.apache.orgSubject: Re: Inserting
Default values if object member
Whoops wrong attribute.You need to use null="" and not nullValue.This should substitute the given value for any property that is null.NathanOn Nov 14, 2005, at 12:09 PM, Jason Hall wrote: Yah, but the db column is set to not null, so you would get a database error. I've tried that anyhow, and
Yah, but the db column is set to not null, so you would get
a database error.
I've tried that anyhow, and got that not null error.
I believe the nullValue is used for a replacement to insert a null value not to
define a default in the
event the object property is null.
thx:)
From: [EMA
You should use removeFirstPrepend="true" on the dynamic-tag, this causes iBATIS
to skip the first prepend encountered.
Hope this helps,
Niels
From: John Chien [mailto:[EMAIL PROTECTED]
Sent: maandag 14 november 2005 18:30
To: user-java@ibatis.apache.org
You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column.NathanOn Nov 14, 2005, at 11:16 AM, Jason Hall wrote: Hi, I just want to know if an object member is set to null and the database column is configured as not null, is there a way in th
No, and as a rule, we try to avoid coding to "maybe requirements" - if
you don't *need* it, don't write it.
:-D
Larry
On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote:
> I know I can use a database default or initialize the java property but
> I just
> Wanted to know if it is also possible in
I know I can use a database default or initialize the java property but
I just
Wanted to know if it is also possible in the sqlmapconfig.xml file.
They may be some
requirements not to do it in java or the database itself.
Is there a way?
-Original Message-
From: [EMAIL PROTECTED] [mailt
Uhm, use a database default?
Larry
On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I just want to know if an object member is set to null and the database
> column is configured as not null,
> is there a way in the sqlmapconfig.xml to set a default value say -1 in a
> parameter ma
Hi,
I just want to know
if an object member is set to null and the database column is configured as
not null,
is there a way in
the sqlmapconfig.xml to set a default value say -1 in a parameter
map.
I've used nullValue
but this is not exactly what i want. I need a default value like a da
John,The WIKI is always a great place to start :)http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Homehere is the specific FAQ about logging.http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How+do+I+get+SqlMapClient+to+log+SQL+statementsTry to get that to work first.I wo
Nathan:
How can I turn on the logging of ibatis ?
The statement just does not run.
I think the problem is that the three statement in the
will produce something like (OR OR OR
)
Thus the where clause will become like:
WHERE p.CORP_ID = c.CORP_ID AND c.CORP_ID = a.CORP_ID AND
(OR OR O
First off by "not run well" do you mean that there is an error? if
so please post it.
Second turn on logging to make sure the sql appears as you would
expect it to.
Third it appears that you are sending in an array of objects as
parameters. I would suggest that you use a java bean with
Dear Sir:
I have a question related to dynamic statement
As shown below, I have a select statement for data in three tables
The GUI has three input fields. Their value can not be determined before
hand.
Besides of doing the join of the tables, I want to have a dynamic where
clause so that th
OK, so this problem doesn't seem to be very high on anyone else's list. But
just in case anyone else ever wants to do this, I've posted a possible
patch on jira:
http://issues.apache.org/jira/browse/IBATIS-221?page=all
- gary
---
Why are you doing this? It makes no sense.
The purpose of the DAO pattern is to eliminate this kind of thing from
your application.
Write one method in your DAO to do all of this, and be done with it.
Larry
On 11/14/05, Corneliu Rudeanu <[EMAIL PROTECTED]> wrote:
>
> My intention is to mix SQL
My intention is to mix SQL Mapper statements with DAO accesses in the
same transaction. My code could look like this:
sqlMapClient.startTransaction();
sqlMapClient.update("updateUser", theUser);
daoManager.getDao(UserDAO.class).load(theUser);
sqlMapClient.commitTransaction();
sqlMapClient.endTran
29 matches
Mail list logo