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 Fri, 12 Jun 2009 02:29:38 GMT
Hello Jeff, thanks for the reply. I suspected as much but now I'm back to square one as my
test cases have errors after trying to handcode the Sqlmap.xml. I even completely commented
out and then removed altogether the changes made but unrelenting the maven test is returning
an ugly stack trace. I going to regen: meanwhile suggestions much appreciated. Regards, David.


**********************************************
org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar [];
nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
The error occurred in org/appfuse/dao/ibatis/bullmaster_SqlMap.xml. 
The error occurred while applying a parameter map.  
Check the bullmaster.ibatorgenerated_selectByPrimaryKey-InlineParameterMap.  
Check the statement (query failed).  
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'BreedCode'
in 'field list'


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

Hi David,
There's nothing that I know of that generates joins with Ibator.  Honestly,
it's a big job to do this automatically. It's been a subject on this list
many times.  For now, hand coding is the way to go.

Jeff Butler



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

> Hello Jeff, excuse the top post but I just have to say that IBator/IBatis
> has saved me a whole bunch of time. I have a 22 column table completely unit
> tested for both: select and update. Ordinarily, I would still be futsing
> around with JDBC or (cringe...) hibernate or some other ORM gadget.
>
> I have been doing some reading and to cut-to-the-chase I was just
> wondering: is there an IBator plugin repo where someone has deposited a
> class extending SqlMapConfig that will generate a two or three-way join? If
> not, I'll follow the doco where it says to handcode joins. Regards, David.
>
>
>
> ----- Original Message -----
> From: "David Brown" <dbrown@sexingtechnologies.com>
> To: user-java@ibatis.apache.org
> Sent: Thursday, June 11, 2009 10:13:27 AM GMT -06:00 US/Canada Central
> Subject: Re: IBatis noob/hibernate refugee
>
> 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