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, J
I think its called queryForMap :-)
From: Mikael Andersson [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 6:28 AM
To: user-java@ibatis.apache.org
Subject: Mapping reuslt to to java.util.Map with dynamic
key(from column),
On Wed, Apr 4 2007, Jared Blitzstein wrote:
> Is it possible to move the sqlmap xml files to a subdirectory
> in the / WEB-INF/ of my web app? I'm trying not to mix xml
> files in my class files and thought this might be a cleaner
> approach. Everything I've found so far mentions about them
> b
Its my understanding that you're property name should start with a
lowercass letter, not an uppercase letter.
getMyProperty() will get the "myProperty" property. There is no
"MyProperty", and no way to create one, short of implementing a BeanInfo
class. Who wants to do that? And I don't think iBA
This is something I've often thought about in regards to ANY ORM. iBATIS
and Hibernate. I've come up with two solutions.
One, add behavior to your POJOs, and ask that consumers of your classes
don't use the getters/setters which iBATIS uses.
Two, Create behavior rich classes which hold/own the dat
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 ? ",
s
It looks like his problem is that every row adds a ,
which is incorrect behavior.
But, It could also be that his CustomRowHandler is incorrectly
implemented.
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 14, 2007 2:20 PM
To: user-java@ib
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 and
Depending on whether you need to be able to "add/remove" from the
Objects list after its set:
public void setObjects(List objects) {
this.objects = objects == null ? Collections.emptyList() : objects;
}
// or
public void setObjects(List objects) {
this.objects = objects == null ? new Arra
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 t
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 yo
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 WEB-INF/log4j.p
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 iBATI
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 hav
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.
" select * from
task_url_$values[]$"
-Original Message-
From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 19, 2006 6:33 AM
To: user-java
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 [ma
e.org
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 ma
From: Daniel Pitts
[mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 1:42
PMTo: user-java@ibatis.apache.orgSubject: RE: Populating
existing beans...
Thanks for the reply.
I'm well aware of queryForMap, but the problem isn't
grouping the objects.
Basically, I have a bean &
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 d
I have a
Map 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
myself?
I know
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 stateme
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 [mailt
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 comple
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] Sent
I have something like the following:
class Foo {
Integer fooId;
String name;
Map> bar = new HashMap>();
// getters/setters bellow.
}
Table foo has (fooId, name) and table barMap has (fooId, a, b)
SELECT * from foo join barMap using (fooId) WHERE fooId = #fooId#
utside 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. > and <
On 8/23/06, Daniel Pitts <[EMAIL PROTECTED]> wrote:
>
>
> I believe the cda
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: user-java@ibatis.apach
ink it's better to start a transaction and make multiple 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?Suc
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#);
INSERT INTO ho (#bar#, #hos[]#);
Thanks.
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: IBA
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 poi
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 But
I want to perform a query like:
Select * FROM data AS `root:data` JOIN other AS `root:other` JOIN
something as `root:other:something` WHERE $where$
The tables "data", "other", and "something" may or may not have
similarly named columns. The aliases correspond to bean's in a map.
---CODE---
Map
It looks to me like the selectKey isn't allowed to be dynamically used.
You might have to make two separate cases, and compare documentId in
java code.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 23, 2006 3:23 PM
To: ibatis user list
Subject
I have a very generic query which has different column names, depending
on what was passed to it.
SELECT $columns$ FROM $from$ WHERE $where$
It works fine the first time. And it even works fine if $columns$
doesn't change. However, if $columns$ had (for instance) "my_column" in
one quer
I'm trying the following dynamic query, and ibatis throws an exception
on initialization. (Even before I call the query) The exception is a
Probe exception, cannot find ordinal for JavaBean , caused by
NumberFormatException from string "".
Can anyone tell me what I'm doing wrong?
Query:
I want to perform query and map the results by a specific column... The
rows may have non-unique values for the specified column, and I'd like
to have it build a list if possible. Any ideas?
@ibatis.apache.org
Subject: Re: 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.
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
42 matches
Mail list logo