Yes,
SQL has a notation to INSERT multiple entries at once.
What you want to do is build a statement like the
following:
INSERT INTO fruit (id, name) VALUES (0, 'Pear'), (1,
'Apple'), (2, 'Peach')
Use the tag to build the dynamic list at the
end. In this example, the GroceryBag object has a
pro
On 11/3/05, Steven Pannell <[EMAIL PROTECTED]> wrote:
Hi,Is there a faster way of performing bulk inserts?currently I do something like:
for(int i=1;i < list.size(); i++) { MyObject object = list.get(i); sqlMapClient.insert("myInsert", object);}This seems to take forever! Is is possib
Hi,
Is there a faster way of performing bulk inserts?
currently I do something like:
for(int i=1;i < list.size(); i++) {
MyObject object = list.get(i);
sqlMapClient.insert("myInsert", object);
}
This seems to take forever! Is is possible to pass the complete list or
somethi
Have you looked into using sql fragments? Those can save you a bundle
of typing if that is your only concern - they can even include all of
the attributes of your result map.
Larry
On 11/2/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
> Larry,
>
> The reason I ask is because my Fruit object actua
Larry,
My other option is to say "heck with solving the N+1
problem!" and turn my nested resultMaps into nested
selects. For each object, execute N selects for N
inner objects it would sure clean up my code!
Man, I feel so alone here LOL I am sorry no one else
has really complex queries which
On 11/2/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
> I could use iBATIS and Hibernate side by side, but
> that would be an odd combination.
I have to confess that I was involved in a project that did just that.
For the love of all that is good and right in the universe, don't do it.
It was *th
So does the iBATIS community recommend I turn to
Hibernate for my kind of situation? Oh, my poor code -
torn between loves :-) I loved everything about iBATIS
until I had to eagerly retrieve complex inner objects
using JOINs. Please inform me if iBATIS offers any
good solution to my problem. I coul
+1
That's exactly what I do too.
--- Larry Meadors <[EMAIL PROTECTED]> wrote:
> I generally name my key fields uniquely, but leave the others what
> they are, for example:
>
> create table Fruit (
> fruitId int,
> name varchar(30)
> )
>
> Then if I join to another table with a "name" fiel
Paul Benedict wrote:
I am in the same situation (see my posts about my
Fruit object). I am curious about how you feel about
needing to list out, if you do, all your columns for
those 4 objects to retrieve a Vendor. This assumes
you're not doing 4 selects, but one select using
joins.
Hi Paul,
I have a DAO interface which is implemented by a
subclass of Spring's SqlMapClientDaoSupport
--- Michael Campbell <[EMAIL PROTECTED]>
wrote:
> Just a general note here... not every tool is
> suitable for every project.
> iBatis solves a very LARGE set of needs, but it
> might be that it just
> d
Just a general note here... not every tool is suitable for every project.
iBatis solves a very LARGE set of needs, but it might be that it just
doesn't solve THIS one (it might, but it's sounding like not...)
Good luck in any case, and I wish I had a nifty solution for you.
Out of curiosity, are
Reuben (I hope that's your first name :-)),
>> Vendor / Branch / Employee / Address
>> When I load a Vendor, I wish (if at all possible)
to load it from the cache, since it contains all sub
objects (Branch, Employee, Address), and is rather
big.
I am in the same situation (see my posts about my
F
Larry,
The reason I ask is because my Fruit object actually
contains very important inner objects which must be
retrieved too.
class Fruit {
Skin s;
Color c;
Producer p;
}
These are retrieved everytime and are very important
to the application. I have independent sqlMap selects
which ar
Hi Henry,
So what the issue? Procedure not created in db?
-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 2:50 PM
To: user-java@ibatis.apache.org
Subject: Re: call procedure error
Thank you very much to remind me. I made stupid mistakes.
Thank you very much to remind me. I made stupid mistakes.
-Henry
Rao, Satish wrote:
Hi Henry,
I am not sure... But from the error you are getting, it seems the
procedure is not created in the database.
Did you try executing the procedure via SQL Plus?
-Original Message-
From: Henry L
Hi Henry,
I am not sure... But from the error you are getting, it seems the
procedure is not created in the database.
Did you try executing the procedure via SQL Plus?
-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 2:26 PM
To: user-java@iba
No, not all.
-Henry
Rao, Satish wrote:
Hi Henry,
Does the procedure have any IN or OUT parameters?
-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 2:22 PM
To: user-java@ibatis.apache.org
Subject: call procedure error
Could someone he
Hi Henry,
Does the procedure have any IN or OUT parameters?
-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 2:22 PM
To: user-java@ibatis.apache.org
Subject: call procedure error
Could someone help me out this when I call a procedure in ORA
Could someone help me out this when I call a procedure in ORACLE:
{call set_active_all }
where set_active_all is a prcedure name.
and calling function is:
public void call_procedure()
{
getSqlMapClientTemplate().insert(
"call_procedure", null);
}
and errors are:
Exactly my point...just better said. :)
Larry
On 11/2/05, Michael Campbell <[EMAIL PROTECTED]> wrote:
> there is a big difference between "The full power of SQL"
> and "The power of full SQL".
Clinton Begin wrote:
Don't worry, we don't intend to abandon XML. But instead, we intend to
support a more robust Java API to allow developers to do both full
mapped statement configuration from Java, as well as execute ad-hoc SQL
statements.
Cheers,
Clinton
Sounds great! Thanks for the re
On 11/2/05, Larry Meadors <[EMAIL PROTECTED]> wrote:
> On 11/2/05, Ben Munat <[EMAIL PROTECTED]> wrote:
> > Larry Meadors wrote:
> > > DDL != SQL :)
> > >
> > There may be other ways of defining a DDL, but to most people it means
> > "create", "drop"
> > and "alter", which are ANSI SQL.
> >
> > It
Hi Clinton, this is actually use case based.
Let me put *example* names to my tables to illustrate:
Vendor / Branch / Employee / Address
When I load a Vendor, I wish (if at all possible) to load it from the
cache, since it contains all sub objects (Branch, Employee, Address), and
is rather big.
On 11/2/05, Ben Munat <[EMAIL PROTECTED]> wrote:
> Larry Meadors wrote:
> > DDL != SQL :)
> >
> There may be other ways of defining a DDL, but to most people it means
> "create", "drop"
> and "alter", which are ANSI SQL.
>
> It seems disingenuous of iBatis to claim it -- as David points out --
>
Don't worry, we don't intend to abandon XML. But instead, we
intend to support a more robust Java API to allow developers to do both
full mapped statement configuration from Java, as well as execute
ad-hoc SQL statements.
Cheers,
Clinton
On 11/2/05, Ben Munat <[EMAIL PROTECTED]> wrote:
Clinton Beg
Clinton Begin wrote:
No, I would avoid that. I'm not sure what the appeal is of doing
something like this. More XML and less Java? I'm finding the opposite
opinion is more common these daysless XML and more Java. In fact,
one of the highest priority features of iBATIS 3.0 is XML-less
Larry Meadors wrote:
DDL != SQL :)
There may be other ways of defining a DDL, but to most people it means "create", "drop"
and "alter", which are ANSI SQL.
It seems disingenuous of iBatis to claim it -- as David points out -- "provides the full
power of SQL", when it doesn't support three of
Balayn, Anna wrote:
Looking for sample code for processing result set returned as
Ref Cursor (Oracle)
I am trying to use IBATIS with Oracle
stored procedures. We have many procedures that return Ref Cursor as
an OUT parameter. It seems that there is a way to process a Ref Cursor
Title: Message
Hi
Anna,
You
need to use a TypeHandlerCallback to map RefCursor and then iterate thru the
ResultSet.
Here's
a sample code.
InOutParams.java
public
class InOutParams implements Serializable {
//IN parameters private String state; private
ResultSet outRS;
..
On 11/2/05, David Moss <[EMAIL PROTECTED]> wrote:
> Thanks,
>
> I'm a little disappointed that DDL isn't supported in some shape or
> form. After all, iBATIS does claim to provide me with 'the full power
> of SQL'. However, I suppose that as iBATIS is aimed at mapping data
> objects to relational
Title: Looking for sample code for processing result set returned as Ref Cursor (Oracle)
I am trying to use IBATIS with Oracle stored procedures. We have many procedures that return Ref Cursor as an OUT parameter. It seems that there is a way to process a Ref Cursor but I can't fi
Hi Clinton,
I'm going to fill in one feature request for this issue.
Cheers,
Daniel Silva.
On 11/2/05, Clinton Begin <[EMAIL PROTECTED]> wrote:
>
> Yeah, that's definitely something I want to work on. I'd love to improve
> ParameterMaps so that they are simply external context (i.e. extra det
Yeah, that's definitely something I want to work on. I'd
love to improve ParameterMaps so that they are simply external context
(i.e. extra details) around named inline parameters.
I don't like ? marks any more than you do. But for some reason I
failed to think of that when I originally wrote
Could you post your complete resultMap?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: maandag 31 oktober 2005 20:41
To: user-java@ibatis.apache.org
Subject: error while using a CTH
Here is the error.
com.ibatis.dao.client.DaoException: Error executing query
Nathan,
Congratulations. You've won the award for "Most Complex Stuff Done With a CTH".
Now you can stop. ;-)
Cheers,
ClintonOn 10/31/05, Nathan Maves <[EMAIL PROTECTED]> wrote:
Here is the error.com.ibatis.dao.client.DaoException: Error executing query for list.Cause: com.ibatis.common.jdbc.
Could be a bug...if you use inline SQL, does the selectKey execute after the statement?
If so, we'll need a bug report in JIRA for this.
Cheers,
ClintonOn 10/31/05, Zsolt <[EMAIL PROTECTED]> wrote:
Hi,if I use the block below "Any ideas? I use ibatis ibatis-2.1.5.582
This is a feature that will need to be added to the Log Proxy framework in iBATIS.
Zsolt, could you add the JIRA request for this?
Thanks,
Clinton
On 10/31/05, Zsolt <[EMAIL PROTECTED]> wrote:
Hi,I see the SQL statements in log4j log file but not if I execute batchcommands using startBatch and
Unfortunately you can't mix lazy loading with serializable caches
This is not an iBATIS problem, but more of a CGLIB and/or Java
problem. I'm sure we could find some crazy means of managing
this, but I'd rather not. The real solution is to tell Sun that
we want dynamic proxies for classes,
It should be possible, but I can't even remember. More importantly, why would you do that?
If your set is fixed enough to be enumerated to
customField1...customField3, then why wouldn't you just have 3
properties on your class called CustomField1 ... CustomField3?
You're creating potential for
Ah, now I see. When you use parameterMaps you should use ?'s instead of
using the inline #'s, you already mapped properties to fields, so there
is no need to do that again. When you want to use a property multiple
times you need to declare it multiple times in the parameterMap too. The
only thing y
Try trimming the CHAR field, as it may be padded with whitespace.
Cheers,
ClintonOn 10/28/05, Voorhoeve, Niels {PBG} <[EMAIL PROTECTED]> wrote:
I've got a problem with the following config below.I am testing with a UserCostCenterDept object with the userId set as aparam. When I pass in an object
No, I would avoid that. I'm not sure what the appeal is of doing
something like this. More XML and less Java? I'm finding
the opposite opinion is more common these daysless XML and more
Java. In fact, one of the highest priority features of iBATIS 3.0
is XML-less iBATIS. ;-)
Cheers,
Clin
Well...it's hard to guess at the cause when you throw in "and native
JDBC connectivity". We have no idea what that could be doing.
My only suggestion would be to ensure that you're properly closing
connections (and all other resources in the case of the native JDBC --
statements, resultsets and
I would suggest to avoid building cache models of that
complexity. Remember, cache models are not intended to be
associated with result maps, nor dependencies based on result map
configurations.
iBATIS cache models are statement (a.k.a. use case) based, not object id (a.k.a. holistic) caches.
Correct. A cache model will only work with results, not with
output params (because you passed the object in), and certainly not
with Oracle cursors (because they are live connections to the DB).
Cheers,
ClintonOn 10/26/05, Rao, Satish <[EMAIL PROTECTED]> wrote:
Does cacheModel only w
You can't use the same paginated list for two different threads.
The root of this problem seems to have nothing to do with iBATIS...but
does suggest a serious design problem in your application.
Sorry to sound harsh, but I wouldn't be doing you any favors if I softened that message. :-/
Chee
Hi Niels,
Thanks for your reply.
I tried removing CDATA and it still doesn't work.
I was talking to Larry last nigh about this issue and he pointed an
interesting issue with parameter maps. If you look at my statement,
you'll see that i use parameters more than once along the statement.
So, it se
Thanks,
I'm a little disappointed that DDL isn't supported in some shape or
form. After all, iBATIS does claim to provide me with 'the full power
of SQL'. However, I suppose that as iBATIS is aimed at mapping data
objects to relational tables, perhaps DDL doesn't really fit within the
brief
Yes you can pass a java properties object into the sqlmapbuilder when you
create your Sqlmap client . Take a look at the java docs..
Steve
From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]
Sent: Wed 02/11/2005 07:47
To: user-java@ibatis.apache.org
Subject:
http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html
If you go to this web site, the mysql has categoried the select last_insert_id as non thread safe. But again it depends how the programming that involved using the same statement instance or not.
I think let go for
50 matches
Mail list logo