Does iBATIS use Introspector and BeanInfo? If it does (and it should!), then
you can create a custom BeanInfo class that defines the getter/setter methods
for particular properties.
From: Clinton Begin [mailto:[EMAIL PROTECTED]
Sent: Friday,
Perhaps moving that logic out of your xml file into Java land.
Assuming you have a Map as the parameter.
boolean useSupplierForParts =
Boolean.valueOf(parameters.containsKey(supplierCompanyId) ||
parameters.containsKey(supplierRef));
Parameters.put(supplierTable, useSupplierForParts ? ,
Off the record, CNET is using it for certain applications.
-Original Message-
From: Mark Volkmann [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 13, 2007 9:22 AM
To: user-java@ibatis.apache.org
Subject: who's using it?
You know how when you propose using some new software library
Depending on whether you need to be able to add/remove from the
Objects list after its set:
public void setObjects(ListObject objects) {
this.objects = objects == null ? Collections.emptyList() : objects;
}
// or
public void setObjects(ListObject objects) {
this.objects = objects == null
I'm passing in a Collection in the parameter map.
This allows me to pass in a Set, but ibatis doesn't seem to handle this:
com.ibatis.common.beans.ProbeException: The 'ids' property of the
java.util.HashMap class is not a List or Array.
Seems like a possible bug?
Injection using blah.getFoo().setBar(bar); should be fine. There isn't
any setFoo, but its not a private injection.
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 06, 2007 12:31 PM
To: user-java@ibatis.apache.org
Subject: Re: cannot write
iBATIS is used to wrap JDBC, so that you don't have to deal with the low
level details.
If you want to deal with the low level details, simply don't use iBATIS.
You are going to have an overhead if you use wrapper, but the overhead
is probably minimal.
Do things the normal iBATIS way, and if
Turn logging level to WARN?
From: Urban, John
[mailto:[EMAIL PROTECTED] Sent: Wednesday, November 01, 2006
12:19 PMTo: user-java@ibatis.apache.orgSubject: Turning
Off Ibatis SQL Mapper info..
Cannot figure out how to turn off
logging. Not set it conf/log4j.xml of jboss or
Looks like a problem with the way ibatis handles collections. Is it
possible to iterate over the addresses, rather than manually select [0]
and [1]?
Also, might it be better design (if there is always going to be exactly
two) to have them be individual properties? streetAddress,
apartmentAddress?
We ran into a similar problem (same
situation)
Although, we happened to have an RMI connection between
the tool and front-end, so we used that to send "flush"
commands.
I wouldn't recommend that though, trying to keep the
two synchronized was a pain.
Actually, I don't know much about
I would guess that you should omit event_id. Instead
setting it in your java code to the return valid of the insert()
method.
From: Okan Çetin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 5:08 PMTo:
user-java@ibatis.apache.orgSubject: Postgresql serial type
problem
I
Your iterate tag needs to specify what its iterating.
I forget off the top of my head, but I think it's the value attribute.
iterate conjunction= union all value=values select * from
task_url_$values[]$/iterate
-Original Message-
From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]
Even if they don't follow the spec, here is a work around:
Create a object wrapper that DOES follow the spec, and it just delegates
to the legacy object.
If you can, however, I would refactor it to be more appropriate for
modern coding practices.
-Original Message-
From: Nathan Maves
I have a
MapInteger, MyBean byId;
Which was built by byId.put(myBean.getId(), myBean);
MyBean is the base class, there are many types of MyBean objects.
Is there a away to tell iBATIS to use the bean in byId map as the
result object? Or do I have to get the result, and copy the values over
Thanks for the reply.
I'm well aware of queryForMap, but the problem isn't
grouping the objects.
Basically, I have a bean "graph" (or tree, or whatever)
that has been constructed before there is enough information to run the final
query. Also, I don't know the bean class before hand (and
Subject: RE: Populating existing beans...
On Tue, 2006-09-12 at 13:49 -0700, Daniel Pitts wrote:
To clarify more,
I have a bunch of beans of different classes. There is a table for
each class of bean, with columns that correspond directly to bean
properties. This makes it easy to do things
If you read carefully, you'll see that there is no
WRITEABLE property named "Firstname" in class
"com.domain.User"
This means that your com.domain.User class doesn't have a
"setFirstname" method.
Also, the property should be start with lowercase, e.g.
"firstname".
From: Okan Çetin
Try executing the query manually in an sql client. Do you
get any results?
If not, thats your problem.
Also, make sure you're using namespaces
properly.
From: Okan Çetin [mailto:[EMAIL PROTECTED]
Sent: Friday, September 08, 2006 1:12 PMTo:
user-java@ibatis.apache.orgSubject: select
I think his parameter class has a property named "track"
which is a bean with a property named "id".
Anyway, I would probably debug (either set a break point,
or just println) the value of track and track.getId() before calling this
query.
From: puneet arya
[mailto:[EMAIL PROTECTED]
I'm having a hard time with groupBy and hashmaps. I'm getting an
exception:
Error instantiating collection property for mapping 'blog'. Cause:
java.lang.ClassCastException: java.lang.Object
I call queryForMap(getBlogAndCategoriesForContent, parameters, blog,
category);
When my query completes,
Is there a way to run an SQL script from iBATIS?
Such as:
INSERT INTO foo (#bar#, #baz#);
INSERT INTO ho (#hum#);
Also, if there is, is it possible to dynamically generate the SQL to do
so?
Eg:
INSERT INTO foo (#bar#, #baz#);
iterate property=hosINSERT INTO ho (#bar#, #hos[]#);/iterate
Thanks.
ple calls to the
different insert statements. More portable, and probably more
maintainable.
Jeff Butler
On 8/23/06, Daniel
Pitts [EMAIL PROTECTED] wrote:
Is
there a way to run an SQL "script" from iBATIS?Such as:INSERT INTO foo
(#bar#, #baz#); INSERT INTO ho (#hum#);Also, if there i
I believe the cdata start/end will cause the dynamic tags
to be escaped, and therefor not interpreted by iBATIS.
I would guess your second suggestion is the correct
one.
From: Mississippi John Hurt
[mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 1:01
PMTo:
or outside of statement tag
I tend to not use them at all. The only time I would need them is for
the standard less then or greater then symbols.
Instead I just use the html code to do this. gt; and lt;
On 8/23/06, Daniel Pitts [EMAIL PROTECTED] wrote:
I believe the cdata start/end will cause
I have something like the following:
class Foo {
Integer fooId;
String name;
MapInteger, ListInteger bar = new HashMapInteger,
ListInteger();
// getters/setters bellow.
}
Table foo has (fooId, name) and table barMap has (fooId, a, b)
select id=getFoo resultMap=fullFoo
I have a table that looks something like this:
external_maps
Parent externalId type
1 1 1
1 2 1
1 3 1
1 8 2
1
Perhaps the JUnit test is using a different sqlMap xml file? Check and
see. If it is, make sure that the JUnit's sqlMap xml file is
valid/correct.
-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 11:05 AM
To: user-java@ibatis.apache.org
Subject:
Try the ibatis website? http://ibatis.apache.org/dotnetdownloads.cgi
-Original Message-
From: xianwinwin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 1:46 PM
To: user-java@ibatis.apache.org
Subject: Re: SQL request with optional where
thank you larry, could you kindly
Honestly, the solution I would choose is very
different
Make a "Pets" table that has both dog and cat
:-)
Or, if you must use this schema... When you query for
people, do one query for "People with Cats", and one for "People with Dogs" and
then merge the results.
From: Jeff Butler
I want to perform a query like:
select id=getData resultClass=map parameterClass=string
Select * FROM data AS `root:data` JOIN other AS `root:other` JOIN
something as `root:other:something` WHERE $where$
/select
The tables data, other, and something may or may not have
similarly named columns.
I want to get a result back as a HashMap with all the columns in the
result being keys in the map. It makes sense for my application to have
'.'s in the column names, but ibatis is trying to map those to
properties of Object instances.
Is there any way to tell ibatis to ignore '.'s in the column
: HashMap results and column aliased with '.' in the name.
You can remap in sql w/ as or map the fields in XML.
.V
Daniel Pitts wrote:
I want to get a result back as a HashMap with all the columns in the
result being keys in the map. It makes sense for my application to
have '.'s in the column
32 matches
Mail list logo