ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Brown <dbr...@sexingtechnologies.com>
Subject Re: IBatis noob/hibernate refugee
Date Thu, 11 Jun 2009 15:13:27 GMT
Hello Jeff, Dude! 4-for-4 por favor! But is there no programmatic/IBatis/config way to prepend
the namespace, in this case, the so-called UsrSql.(dot) to all the getUser and addUser references?
If not that's OK the Usr SQL map is small. At least I'm on my way to a whole bunch of test
cases that won't fail. And, IBatis is Mucho Cool!

Mucho Thanks,

David.



----- Original Message -----
From: "Jeff Butler" <jeffgbutler@gmail.com>
To: user-java@ibatis.apache.org
Sent: Thursday, June 11, 2009 7:55:56 AM GMT -06:00 US/Canada Central
Subject: Re: IBatis noob/hibernate refugee

There's nothing new under the sun :)

It's probably still related to namespaces. Once you turn them on, they must
be used everywhere.  Look in the Java code for the failing stuff - the
iBATIS call should look like this:
xxx.queryForList("*namespace*.getUsers", parameterObject);

Note that the SqlMap namespace must precede every SqlMap ID.

Jeff Butler


On Wed, Jun 10, 2009 at 11:08 PM, David Brown <dbrown@sexingtechnologies.com
> wrote:

> Hello Jeff, Wow! you're 3-for-3. The truth is I'm using 2 sql maps. The
> original AppFuse map and the new map for my tables. The curiosity is now the
> original sql map is failing the tests and my unit tests are passing?! Again,
> here is what I am getting in the stack trace:
>
> ************************************************
> com.ibatis.sqlmap.client.SqlMapException: There is no statement named
> getUsers in this SqlMap
>
>
> Clearly, if I look into the IBatis DAO responsible for generating this
> exception there is a method: getUsers() and the sql.xml seems to correctly
> reference the method in the sql statement xml elements.
>
> I think I am very close, please advise, David.
>
>
>
> ----- Original Message -----
> From: "Jeff Butler" <jeffgbutler@gmail.com>
> To: user-java@ibatis.apache.org
> Sent: Wednesday, June 10, 2009 9:19:52 PM GMT -06:00 US/Canada Central
> Subject: Re: IBatis noob/hibernate refugee
>
> My best guess is that you need to enable statement namespaces in your
> SqlMapConfig file.  See here for an example (see the <settings> element):
> http://ibatis.apache.org/docs/tools/ibator/afterRunning.html
>
> Jeff Butler
>
>
> On Wed, Jun 10, 2009 at 7:46 PM, David Brown
> <dbrown@sexingtechnologies.com>wrote:
>
> > Hello Jeff, thanks a bunch. This really launched everything. IBatis is a
> > real project saver for me as hibernate IMHOP does not fair well with a
> > sloppy legacy system. I was on-a-roll with IBatis and the AppFuse light
> CRUD
> > (wicket-ibatis) until I wrote my first test case whereupon I got an RTE.
> > Please see included below. I've pretty much read the doco but I'm not
> > experienced enough to monkey around with the: _SqlMap.xml.  I suspect I
> need
> > to manually or programmatically fix the whereclause. BTW: do you consult?
> If
> > so, what is your hourly and minimum? This project is very important to me
> > and I'm undermanned and on a short leash. I sent some money via paypal
> to:
> > wickettraining.com but never heard anything back. Anyway, IBatis has
> been
> > great insofar as I nearly just dropped IBatis in the AppFuse project and
> it
> > never skipped a beat. If you have any ideas or suggestions please advise,
> > David.
> >
> >
> >
> > ****************************************************
> > Error parsing XPath '/sqlMap/select'.
> > Could not find SQL statement to include with refid
> > 'bullmaster.ibatorgenerated_Example_Where_Clause'
> >
> >
> >
> > ----- Original Message -----
> > From: "Jeff Butler" <jeffgbutler@gmail.com>
> > To: user-java@ibatis.apache.org
> > Sent: Tuesday, June 9, 2009 2:15:40 PM GMT -06:00 US/Canada Central
> > Subject: Re: IBatis noob/hibernate refugee
> >
> > Here's the sample config file from the Ibator documentation:
> >
> http://ibatis.apache.org/docs/tools/ibator/configreference/xmlconfig.html
> >
> > <
> http://ibatis.apache.org/docs/tools/ibator/configreference/xmlconfig.html
> > >Note
> > that <classPathEntry> is not a child of <jdbcConnection> - rather it
is a
> > child of <ibatorConfiguration>.  You've probably been reading some old
> > documentation for the prior version of the tool.
> >
> > BTW - welcome to iBATIS!
> >
> > Jeff Butler
> >
> >
> >
> > On Tue, Jun 9, 2009 at 2:13 PM, David Brown
> > <dbrown@sexingtechnologies.com>wrote:
> >
> > > Hello Jeff, thanks for the speedy and informative reply. I am leaning
> > > toward Eclipse (if possible). I have Googled and read some IBatis doco
> > but I
> > > can't find the reason for the error condition after adding the tag as
> > > requested: <classPathEntry>. Please find included below the
> > <jdbcConnection>
> > > criteria and the error condition. Thanks and please advise, David.
> > >
> > > <jdbcConnection
> > >  driverClass="com.mysql.jdbc.Driver"
> > >  connectionURL="jdbc:mysql://localhost:3306/test"
> > >  userId="user"
> > >  password="test">
> > >  <classPathEntry location="c:/Program
> > Files/DbVisualizer-6.5.4/jdbc/mysql"
> > > />
> > > </jdbcConnection>
> > >
> > > *************************************
> > > The content of element type "jdbcConnection" must match "(property)*"
> > >
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Jeff Butler" <jeffgbutler@gmail.com>
> > > To: user-java@ibatis.apache.org
> > > Sent: Tuesday, June 9, 2009 12:26:08 PM GMT -06:00 US/Canada Central
> > > Subject: Re: IBatis noob/hibernate refugee
> > >
> > > With the eclipse plugin, you should add a <classPathyEntry> element to
> > > state
> > > where the JDBC driver JAR is.
> > >
> > > With command line, don't add the *iBATIS* JAR, instead add the *Ibator*
> > > JAR.
> > >
> > > HTH -
> > > Jeff Butler
> > >
> > > On Tue, Jun 9, 2009 at 12:22 PM, David Brown
> > > <dbrown@sexingtechnologies.com>wrote:
> > >
> > > > Hello IBatis dev, gurus and mortals, I'm an IBatis noob fleeing from
> > > > hibernate. I have a legacy database that will fair better under
> IBatis
> > if
> > > I
> > > > can get over the learning curve hump. In-all-likelihood this has been
> > > review
> > > > before but my time constraints will not allow me to languish. I have
> > > > installed both the Eclipse Ibatis plugin and the command line
> version.
> > I
> > > > both cases I am failing to generate anything. In Eclipse I have
> filled
> > in
> > > > the ibatorConfig.xml but when I right-click the ibatorConfig.xml file
> > in
> > > the
> > > > Eclipse to run the menu item: Generate IBATIS Artifacts I get a big
> > red-X
> > > > pop dialog the exclaims: Generation Failed. Reason: Unexpected error
> > > while
> > > > running IBator: Exception getting JDBC driver.
> > > >
> > > > IF I attempt largely the same thing using the command-line:
> > > >
> > > > java -jar ..\..\..\st\dev_tools\ibatis\lib\ibatis-2.3.4.726.jar
> > > -configfile
> > > > ibatorConfig.xml -overwrite
> > > >
> > > >
> > > > I get the following error condition:
> > > >
> > > >
> > > > ***************************************************
> > > > Failed to load Main-Class manifest attribute from
> > > > ..\..\..\st\dev_tools\ibatis\lib\ibatis-2.3.4.726.jar
> > > >
> > > >
> > > >
> > > > Any and all ideas for an IBatis noob will be greatly appreciated.
> > Please
> > > > advise, David.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > There are 10 kinds of people in this world: those who understand
> binary
> > > and
> > > > those who don’t (Valid only for 2's complement).
> > > >
> > >
> >
>

Mime
View raw message