You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Charles_Magid <Ch...@comcast.net> on 2007/07/31 22:58:59 UTC

Newbie DAO question: Methods missing from Abator generated DAOImp file. Am I missing a configuration param for abatorCongif.xml?

I switched over to trying to generate with Abator using DAO.   I added the
DAO jar file ibatis-dao-2.jar.  Then I deleted all of the generated
artifacts. I also added the line: 

<daoGenerator type="IBATIS" targetPackage="com.rbm.db"
targetProject="RBMZeNewPracticeAbatorWithDAO" />

to the abatorConfig.xml file.

 

And I receive the following compile time error.

Severity and Description Path     Resource          Location
Creation Time    Id

The type PromotionitemtextDAOImpl must implement the inherited abstract
method SqlMapExecutor.update(String)
RBMZeNewPracticeAbatorWithDAO/src/com/rbm/db
PromotionitemtextDAOImpl.java  line 9    1185914860910 2569

SqlMapExecutor.queryWithRowHandler(String, RowHandler)

SqlMapExecutor.queryForPaginatedList(String, int)

SqlMapExecutor.queryForObject(String)

SqlMapExecutor.queryForList(String)

SqlMapExecutor.queryForList(String, int, int)

SqlMapExecutor.insert(String)

SqlMapExecutor.executeBatchDetailed()

SqlMapExecutor.delete(String)

 

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Sent: Tuesday, July 31, 2007 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: Newbie question: execution, invocation, doit, getResults ...

 

It depends.

 

If you are using one of the generated DAO classes, you can invoke the
generated "selectByExample" method.

 

If you are not using DAOs, then you do this:

 

List answer =
sqlMap.queryForList("table_namespace.abatorgenerated_selectByExample",
pite);

 

Where "table_namespace" is the value in the generated sqlmap.xml for the
table.

 

It's easier to use DAOs, but it doesn't look like you using them with the
example code below.

 

Jeff Butler



 

On 7/31/07, Charles_Magid <Ch...@comcast.net> wrote: 

I am an Abator & IBatis newbie.  I'm trying to figure out how to invoke my
query given the criteria I have established.  In other words, what goes in 
the area labeled  "Fill in the blank" below?



               Reader reader =
Resources.getResourceAsReader("com/rbm/db/SqlMapConfig.xml");
               SqlMapClient sqlMap =
SqlMapClientBuilder.buildSqlMapClient(reader);
               try {
                       sqlMap.startTransaction();
                       PromotionitemtextExample pite = new
PromotionitemtextExample();

pite.createCriteria().andPromonetPromotionIdEqualTo(4);
                       Promotionitemtext pit = [Fill in the blank]
                       System.out.println(pit.toString());
                       sqlMap.commitTransaction ();
               } finally {
                       sqlMap.endTransaction();

               }

 


Re: Newbie DAO question: Methods missing from Abator generated DAOImp file. Am I missing a configuration param for abatorCongif.xml?

Posted by Rinaldo Bonazzo <rb...@sardiniapoint.it>.
Thank u jeff

I don't know this method
certainly I don't read the doc in the correct way thank's again

Rinaldo


Jeff Butler ha scritto:
> I don't understand...why are you using jedit to do this when Abator 
> will do it for you already?
>  
> <daoGenerator type="SPRING" targetPackage="com.rbm.db" 
> targetProject="RBMZeNewPracticeAbatorWithDAO" />
>  
> Jeff Butler
>
>  
> On 8/1/07, *Rinaldo Bonazzo* <rbonazzo@sardiniapoint.it 
> <ma...@sardiniapoint.it>> wrote:
>
>     Hi to all,
>     I use abator with daoGenerator to create my classes.
>     After the creation I use my editor like jedit who permit to change
>     all string in files present in a directory
>     the class as to extends SqlMapClientDaoSupport (from spring DAOs)
>     alla then insert method
>     insert("something.abatorgenerated_insert",record) became
>     getSqlMapClientTemplate().insert("something.abatorgenerated_insert
>     ", record);
>     same action for all the others method (update,queryforlist,
>     queryforobject, delete)
>
>     Rinaldo Bonazzo
>
>
>      
>


Re: Newbie DAO question: Methods missing from Abator generated DAOImp file. Am I missing a configuration param for abatorCongif.xml?

Posted by Jeff Butler <je...@gmail.com>.
I don't understand...why are you using jedit to do this when Abator will do
it for you already?

<daoGenerator type="SPRING" targetPackage="com.rbm.db"
targetProject="RBMZeNewPracticeAbatorWithDAO" />

Jeff Butler


On 8/1/07, Rinaldo Bonazzo <rb...@sardiniapoint.it> wrote:
>
> Hi to all,
> I use abator with daoGenerator to create my classes.
> After the creation I use my editor like jedit who permit to change all
> string in files present in a directory
> the class as to extends SqlMapClientDaoSupport (from spring DAOs)
> alla then insert method insert("something.abatorgenerated_insert",record)
> became
> getSqlMapClientTemplate().insert("something.abatorgenerated_insert",
> record);
> same action for all the others method (update,queryforlist,
> queryforobject, delete)
>
> Rinaldo Bonazzo
>
>
>
>

Re: Newbie DAO question: Methods missing from Abator generated DAOImp file. Am I missing a configuration param for abatorCongif.xml?

Posted by Rinaldo Bonazzo <rb...@sardiniapoint.it>.
Hi to all,
I use abator with daoGenerator to create my classes.
After the creation I use my editor like jedit who permit to change all 
string in files present in a directory
the class as to extends SqlMapClientDaoSupport (from spring DAOs)
alla then insert method 
insert("something.abatorgenerated_insert",record) became
getSqlMapClientTemplate().insert("something.abatorgenerated_insert", 
record);
same action for all the others method (update,queryforlist, 
queryforobject, delete)

Rinaldo Bonazzo

Jeff Butler ha scritto:
> You need to make sure that you have the latest standalone DAO 
> distribution from the web site - 2.2.0. 
> (http://ibatis.apache.org/javadownloads.cgi)
>  
> But (and we never get tired of saying this) - it would be better if 
> you would use Spring DAOs.  IBATIS DAO is deprecated and will not be 
> further enhanced.
>  
> Jeff Butler
>
>  
> On 7/31/07, *Charles_Magid* <Charles_Magid@comcast.net 
> <ma...@comcast.net>> wrote:
>
>     I switched over to trying to generate with Abator using DAO.   I
>     added the DAO jar file ibatis-dao-2.jar.  Then I deleted all of
>     the generated artifacts. I also added the line:
>
>     <daoGenerator type="IBATIS" targetPackage="com.rbm.db"
>     targetProject="RBMZeNewPracticeAbatorWithDAO" />
>
>     to the abatorConfig.xml file.
>
>      
>
>     And I receive the following compile time error.
>
>     Severity and Description Path     Resource         
>     Location            Creation Time    Id
>
>     The type PromotionitemtextDAOImpl must implement the inherited
>     abstract method SqlMapExecutor.update(String)           
>     RBMZeNewPracticeAbatorWithDAO/src/com/rbm/db       
>     PromotionitemtextDAOImpl.java  line 9    1185914860910 2569
>
>     SqlMapExecutor.queryWithRowHandler(String, RowHandler)
>
>     SqlMapExecutor.queryForPaginatedList(String, int)
>
>     SqlMapExecutor.queryForObject(String)
>
>     SqlMapExecutor.queryForList(String)
>
>     SqlMapExecutor.queryForList(String, int, int)
>
>     SqlMapExecutor.insert(String)
>
>     SqlMapExecutor.executeBatchDetailed()
>
>     SqlMapExecutor.delete(String)
>
>      
>
>     -----Original Message-----
>     *From:* Jeff Butler [mailto: jeffgbutler@gmail.com
>     <ma...@gmail.com>]
>     *Sent:* Tuesday, July 31, 2007 3:53 PM
>     *To:* user-java@ibatis.apache.org <ma...@ibatis.apache.org>
>     *Subject:* Re: Newbie question: execution, invocation, doit,
>     getResults ...
>
>      
>
>     It depends.
>
>      
>
>     If you are using one of the generated DAO classes, you can invoke
>     the generated "selectByExample" method.
>
>      
>
>     If you are not using DAOs, then you do this:
>
>      
>
>     List answer =
>     sqlMap.queryForList("table_namespace.abatorgenerated_selectByExample",
>     pite);
>
>      
>
>     Where "table_namespace" is the value in the generated sqlmap.xml
>     for the table.
>
>      
>
>     It's easier to use DAOs, but it doesn't look like you using them
>     with the example code below.
>
>      
>
>     Jeff Butler
>
>
>
>      
>
>     On 7/31/07, *Charles_Magid* < Charles_Magid@comcast.net
>     <ma...@comcast.net>> wrote:
>
>     I am an Abator & IBatis newbie.  I'm trying to figure out how to
>     invoke my
>     query given the criteria I have established.  In other words, what
>     goes in
>     the area labeled  "Fill in the blank" below?
>
>
>
>                    Reader reader =
>     Resources.getResourceAsReader("com/rbm/db/SqlMapConfig.xml");
>                    SqlMapClient sqlMap =
>     SqlMapClientBuilder.buildSqlMapClient(reader);
>                    try {
>                            sqlMap.startTransaction();
>                            PromotionitemtextExample pite = new
>     PromotionitemtextExample();
>
>     pite.createCriteria().andPromonetPromotionIdEqualTo(4);
>                            Promotionitemtext pit = [Fill in the blank]
>                            System.out.println(pit.toString ());
>                            sqlMap.commitTransaction ();
>                    } finally {
>                            sqlMap.endTransaction();
>
>                    }
>
>      
>
>


Re: Newbie DAO question: Methods missing from Abator generated DAOImp file. Am I missing a configuration param for abatorCongif.xml?

Posted by Jeff Butler <je...@gmail.com>.
You need to make sure that you have the latest standalone DAO distribution
from the web site - 2.2.0. (http://ibatis.apache.org/javadownloads.cgi)

But (and we never get tired of saying this) - it would be better if you
would use Spring DAOs.  IBATIS DAO is deprecated and will not be further
enhanced.

Jeff Butler


On 7/31/07, Charles_Magid <Ch...@comcast.net> wrote:
>
>  I switched over to trying to generate with Abator using DAO.   I added
> the DAO jar file ibatis-dao-2.jar.  Then I deleted all of the generated
> artifacts. I also added the line:
>
> <daoGenerator type="IBATIS" targetPackage="com.rbm.db"
> targetProject="RBMZeNewPracticeAbatorWithDAO" />
>
> to the abatorConfig.xml file.
>
>
>
> And I receive the following compile time error.
>
> Severity and Description Path     Resource          Location
> Creation Time    Id
>
> The type PromotionitemtextDAOImpl must implement the inherited abstract
> method SqlMapExecutor.update(String)
> RBMZeNewPracticeAbatorWithDAO/src/com/rbm/db
> PromotionitemtextDAOImpl.java  line 9    1185914860910 2569
>
> SqlMapExecutor.queryWithRowHandler(String, RowHandler)
>
> SqlMapExecutor.queryForPaginatedList(String, int)
>
> SqlMapExecutor.queryForObject(String)
>
> SqlMapExecutor.queryForList(String)
>
> SqlMapExecutor.queryForList(String, int, int)
>
> SqlMapExecutor.insert(String)
>
> SqlMapExecutor.executeBatchDetailed()
>
> SqlMapExecutor.delete(String)
>
>
>
> -----Original Message-----
> *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> *Sent:* Tuesday, July 31, 2007 3:53 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Newbie question: execution, invocation, doit, getResults
> ...
>
>
>
> It depends.
>
>
>
> If you are using one of the generated DAO classes, you can invoke the
> generated "selectByExample" method.
>
>
>
> If you are not using DAOs, then you do this:
>
>
>
> List answer = sqlMap.queryForList("table_namespace.abatorgenerated_selectByExample",
> pite);
>
>
>
> Where "table_namespace" is the value in the generated sqlmap.xml for the
> table.
>
>
>
> It's easier to use DAOs, but it doesn't look like you using them with the
> example code below.
>
>
>
> Jeff Butler
>
>
>
>
>
> On 7/31/07, *Charles_Magid* <Ch...@comcast.net> wrote:
>
> I am an Abator & IBatis newbie.  I'm trying to figure out how to invoke my
> query given the criteria I have established.  In other words, what goes in
>
> the area labeled  "Fill in the blank" below?
>
>
>
>                Reader reader =
> Resources.getResourceAsReader("com/rbm/db/SqlMapConfig.xml");
>                SqlMapClient sqlMap =
> SqlMapClientBuilder.buildSqlMapClient(reader);
>                try {
>                        sqlMap.startTransaction();
>                        PromotionitemtextExample pite = new
> PromotionitemtextExample();
>
> pite.createCriteria().andPromonetPromotionIdEqualTo(4);
>                        Promotionitemtext pit = [Fill in the blank]
>                        System.out.println(pit.toString());
>                        sqlMap.commitTransaction ();
>                } finally {
>                        sqlMap.endTransaction();
>
>                }
>
>
>