Title: Implicit Mapping and Dynamic SQL
Hi,
I use the following sqlMap statement.
select * from $table$
In my java code this works
List l = queryForList("selectTable","TABLE_A");
but when i do this with same statement id (selectTable) ...
List l = queryForList("selectTable","TABLE_A
Thanks jeff! I appreciate your guy contriburtion. We'll add this one
to the wiki. If you have opportunity to provide a more "correct"
stored procedure that would be great. Again, these kind of resources
are great to have. I appreciate all your guys efforts in getting this
to me.
iBatis has the bes
Well, its late and I'm running out of time to get something to you. So,
I just modified Sven's stuff to make it work on DB2. Still has the same
SQL injection exposure, and is not the way we'd do it in a live
environment, but it does illustrate the concepts. This is also an
example of generating
I am using iBatis SqlMap and iBatis DAO. I am trying to look into
doing batch inserts/updates/delete within a single transaction for
multiple DAO's. So should I create a Service that just handles my
batches and has an instance of each DAO that it needs, or is there a
different way? Anyone have an
Thanks, I see your point.
Larry Meadors wrote:
I mean this is the nicest possible way: This is a silly question, and
the answer is "it depends".
If you have 1000 customers (A) and each of them have 1000 orders (B)
and each order has 25 line items (C), do you really need to load up
25,000,000 ob
Are you using namespaces? Check your sql map config file. If namespaces are enabled, se this instead:
On 5/2/05, Elizabeth Baron <[EMAIL PROTECTED]
> wrote:Hi,I am a new user of iBatis, so thank you in advance for your patience.
Any help or advice you might be able to offer is appreciated.My probl
I mean this is the nicest possible way: This is a silly question, and the answer is "it depends".
If you have 1000 customers (A) and each of them have 1000 orders (B)
and each order has 25 line items (C), do you really need to load up
25,000,000 objects?
If so, buy a buttload of RAM, load them al
Hi,
I am a new user of iBatis, so thank you in advance for your patience.
Any help or advice you might be able to offer is appreciated.
My problem is as follows:
I have set up an SqlMap with a simple cache model and insert statement.
I am trying to force the cache to clear when the update na
I'm having trouble inserting or updating on a varchar2(4000) field in
oracle. It works for anything under a 1000 characters otherwise it
throws an Exception
org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient operation): encountered SQLException [ --- The error occurred in com/
There was talk and I think saw away to getQuerryAsXml.
How/where? Url?
tia,
.V
The only way to make that "clean" is to push the translation effort
into your ActionForm and nest your real beans in the ActionForm. you
would then have a String value that you convert and set into your
nested bean. The other option is to write a different BeanUtils
Converter implementation for num
Hi,
I hava a table 'users' with column dept_id
(id of department in departments table)
This column is optional. That means
the operator doesn't have to assign inserted user to any
department.
If I have bean:
public class UserBean {
Integer
departmentId;
}
struts wil
Ok, looking at the source would tell me that DaoManagerBuilder by
itself will parse the XML file every single time it is called. So you
have to manually check to see if the daoManager instance is null or
not and provide the appropriate action accordingly. So the following
statement is false:
> T
S, you are saying that calling DaoManager.buildDaoManager alone
will parse the dao.xml every single time?? Which is it? It does or
it doesn't. I've got conflicting answers here now. I guess I'll just
break down and look at the source code for that static method.
On 5/2/05, Brandon Goodin
The problem was stupid, of course:)
I used update method instead of insert method for insert mapped statement
( according to jPetstore 4.05)
By the way,
Postgresql 8 allows to execute two dml operations in one sql map statement +
. It makes it much easier to write.
Thanks, a lot
Darek
>
> I
Excellent Sven! Thanks! I'll use your code and give you credit in the book.
I welcome any other examples from others. We can add them to the wiki
for some comparative observations.
Brandon
On 5/2/05, Sven Boden <[EMAIL PROTECTED]> wrote:
>
> How about the following for Oracle... I can also send
The question is more whether I should let the chain of objects populate
itself, or knowing A contains B contains C, populate them all in one
call. The former is more object oriented, while the latter is more
efficient.
I need to load all the child objects, but instead of having one Select
bloc
I wrote chapter 1 and 2 in a fairly language neutral fashion.
Most of the book will focus on the Java implementation. But there
is an appendix for .NET.
The cool thing is that Gilles did such a good job of keeping
consistent, that there are few differences. I can probably count
less than 10
If you have no need to load the child objects then don't use a complex
result in your resultMap.
Brandon
On 5/2/05, Nic Werner <[EMAIL PROTECTED]> wrote:
> Hi,
> I have several objects in my program which have a bit of a
> hierarchy, ie A contains B, B contains C and so on. Each table in the
How about the following for Oracle... I can also send it as an
attachment.
Regards,
Sven Boden
EDS
create table category
(
categoryid char(2),
namevarchar(255),
title varchar(255),
description varchar(255),
sequencenumber
);
insert into category(categoryid, nam
And what method? getResulstAs??
And if object, then ... how to convert to something of use? A string?
tia,
.V
Clinton Begin wrote:
Just set the type to "xml" or "dom" in the result map. "xml" will
return XML as a String, "dom" will return a DOM object.
Cheers,
Clinton
On 5/2/05, *Netsql* <[EMAI
Is your configuration on the classpath or in a web directory? There
_should_ be no resource issues if your Service class is initalizing
the DaoManager. I'd like to hear a little more about how you have
things configured.
Thanks,
Brandon
On 5/2/05, Folashade Adeyosoye <[EMAIL PROTECTED]> wrote:
>
Hi,
I have several objects in my program which have a bit of a
hierarchy, ie A contains B, B contains C and so on. Each table in the DB
is linked to each other by a foreign key on a unique ID. I have iBATIS
populating each Bean by using a resultMap and calling on the object's
Select statemen
I am interested in the latter. I am trying to show a comparison
between coding iBatis
dynamic SQL and coding an equivalent function in a stored proc. I am
more interested in functional equivalence than i am in syntactical
equivalence. I would have preformed this myself. But, i wanted a
chance to ge
I do not think am mingling ibatis and my struts layer
The iniSystem calls a Service class that loads the cache, I only noticed
that whenever super.init(config); is invoked rather than super.init();,
iBatis in the DaoConfig has problems with the ResourceReader...
Hope that clears it..
-O
Why are you mingling iBatis with the servlet layer? Initialization
would be better placed in the service layer.
Brandon
On 5/2/05, Folashade Adeyosoye <[EMAIL PROTECTED]> wrote:
> I found it strange enough that it did make a diff if I pass in a
> ServletConfig config or not...
>
> public void
I'll bite...
What are you trying to show in this comparison?
If you are trying to show that iBatis is better than stored procs for
composing dynamic SQL, then the comparison, to me, is pretty
uninteresting. IMHO iBatis (or almost any other client), is better than
trying to compose dynamic SQL in
I found it strange enough that it did make a diff if I pass in a
ServletConfig config or not...
public void init(ServletConfig config) throws ServletException {
logger.info("ExtendedActionServlet init()...");
super.init(config); <- THIS
initSystem(config
Calls to buildDaoManager resolve to this class:
http://tinyurl.com/9qymm
http://svn.apache.org/repos/asf/incubator/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/dao/engine/builder/xml/XmlDaoManagerBuilder.java
Have you browsed the JPetstore source code:
http://tinyurl.com/bpgl7
http://svn.apac
You will notice that your DaoManager only performs a buildDaoManager
when the DaoManager instance variable of your DaoManagerLoader is
null. After that it will simply return the existing DaoManager. It is
the responsibility of the developer to make sure it is loaded only
once. If you did not prefor
The best way to find this out is to use your IDE to step thru the code and
but break points. I have resulted to that in the last couple of days to
actually see how the framework works but sadly have not been able to get
pass the daoManager = DaoManagerBuilder.buildDaoManager(reader); in my big
>The dao manager does not parse it every time. It only parses once.
Is this documented somewhere? How does that work if my code is
telling the builder to build everytime a service request is made? Is
it cached somewhere in memory much like the hand made singleton class
I am using? I don't want
We are in the process of creating a more current example application now. Sorry for the confusion. :(On 4/30/05, Aitor Imaz <
[EMAIL PROTECTED]> wrote:On 4/29/05, Lieven De Keyzer <
[EMAIL PROTECTED]> wrote:> Right, should have read the API doc. It's because in the JPetStore example> all inserts ar
ATM, it is primarily Java.On 5/2/05, Ron Grabowski <[EMAIL PROTECTED]> wrote:
Is the "upcoming iBatis book" going to be primarily focused on Java orwill equal time be spent on the .Net implementation as well?--- Brandon Goodin <[EMAIL PROTECTED]
> wrote:> Please provide straight JDBC code that call
Is the "upcoming iBatis book" going to be primarily focused on Java or
will equal time be spent on the .Net implementation as well?
--- Brandon Goodin <[EMAIL PROTECTED]> wrote:
> Please provide straight JDBC code that calls the stored procedure.
>
> I wanted to get a few examples from various da
Are you calling the insert mapped statement with the update method of the sql map client?
If you are, selectKey will not get called - it is only used when calling insert().
Larry
On 4/28/05, Darek Dober <[EMAIL PROTECTED]> wrote:
Hi,According to the documentation it should be
easy but it
Just set the type to "xml" or "dom" in the result map. "xml" will return XML as a String, "dom" will return a DOM object.
Cheers,
Clinton
On 5/2/05, Netsql <[EMAIL PROTECTED]> wrote:
Vic Cekvenich (netsql) wrote:> There was talk and I think saw away to getResultsAsXml.>> How/where? Url?>> tia,>
There was talk and I think saw away to getResultsAsXml.
How/where? Url?
tia,
.V
--- Begin Message ---
There was talk and I think saw away to getQuerryAsXml.
How/where? Url?
tia,
.V
--- End Message ---
Vic Cekvenich (netsql) wrote:
There was talk and I think saw away to getResultsAsXml.
How/where? Url?
tia,
.V
Hey all,
I am putting together a comparison of using iBatis dynamic SQL versus
dynamic SQL in a stored procedure. I want to solicit some assistance
on this. If you are willing i would like for you to write a stored
procedure that can accomplish the following requirements.
The stored procedure mus
41 matches
Mail list logo