ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Meijer <mjmei...@xs4all.nl>
Subject Re: Abator regeneration causes duplicated methods
Date Wed, 12 Jul 2006 09:08:44 GMT
Hi Jeff,

The duplicate methods are in ALL files, my table should map to a Cart  
family, so it generates
Cart.java, CartDAO.java, CartDAOImpl.java, CartExample.java, and  
CartKey.java

When regenerating abator strips the comment, but not the field and  
methods, so the result looks like this for CartKey.java:

public class CartKey {

	private Integer cartID;

	public Integer getCartID() {
		return cartID;
	}

	public void setCartID(Integer cartID) {
		this.cartID = cartID;
	}

	/**
	 * This field was generated by Abator for iBATIS. This field  
corresponds to the database column lighting.lcart.c_cartID
	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006
	 */
	private Integer cartID;

	/**
	 * This method was generated by Abator for iBATIS. This method  
returns the value of the database column lighting.lcart.c_cartID
	 * @return  the value of lighting.lcart.c_cartID
	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006
	 */
	public Integer getCartID() {
		return cartID;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method sets  
the value of the database column lighting.lcart.c_cartID
	 * @param cartID  the value for lighting.lcart.c_cartID
	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006
	 */
	public void setCartID(Integer cartID) {
		this.cartID = cartID;
	}
}

Also note that a second  regeneration adds another group of  
uncommented(?) field and set/get methods. The comment with  
@abatorgenerated rertain the dat from the original generation. So the  
problem is twofold:
1) the stuff previously generated is not recognized and deleted (some  
error in regular expression maybe)
2) the newly generated stuff doesn't include comments

The files char-set is MacRoman (as is default on Eclipse Mac) and the  
line endings are UNIX (also default)

If I can be of further assistance, please let me know!

Maarten


> I've tested on Eclipse 3.2 (Windows) and I'm not seeing this  
> behavior - a regeneration works fine for me.  So, here are some  
> questions:
>
> 1. Are the duplicated methods in the DAOs, the model objects, or both?
>
> 2. Did the JavaDoc comments get stripped off the methods somehow  
> before calling Abator?  Abator only knows what to delete by the  
> @abatorgenerated JavaDoc element.
>
>> I'm using Ababator 0.6.5 on Mac OSX with Eclipse 3.2. I've disabled
>> Oxygen to get back the 'Generate iBatis Artifacts' menu item again.
>> I have decided to use the DAO as wll after all, so I added to the
>> abatorConfig.xml:
>>        <daoGenerator type="IBATIS" targetPackage="com.fold1.beans"
>> targetProject="fold1wt">
>>                <property name="enableSubPackages" value="false"/>
>>        </daoGenerator>
>>
>> I then do a 'Generate...' and OPPS, hundreds of errors, mostly
>> duplicate methods/fields.
>> Reason: the old generated code is not removed, just stripped of the
>> comments!
>> How can I get abator to generate correct code?
>>
>> Maarten



Mime
View raw message