I meant e.g
public class CustomerDAOStub implements CustomerDAO
{
public int deleteByExample( CustomerExample example )
{
return 0;
}
public int deleteByPrimaryKey( Integer idcustomer )
{
return 0;
}
public Integer insert( Customer record )
{
record.setIdcustomer( new Integer(0) );
return new Integer(0);
}
public List selectByExample( CustomerExample example )
{
ArrayList list = new ArrayList();
Customer cust = new Customer();
cust.setName( "testname" );
list.add( cust );
return list;
}
public Customer selectByPrimaryKey( Integer idcustomer )
{
Customer cust = new Customer();
cust.setIdcustomer( idcustomer );
cust.setName( "testname" );
return cust;
}
public int updateByPrimaryKey( Customer record )
{
return 0;
}
public int updateByPrimaryKeySelective( Customer record )
{
return 0;
}
}
I think this could be generated too.
and similiar a CustomerStub,
but here it is maybe some overhead if one has a lot of logic in it,
but for simple testing its always a worth.
----- original Nachricht --------
Betreff: Re: StubObjects / ValidationObjects generation feature planned ?
Gesendet: Di 03 Jul 2007 16:11:38 CEST
Von: "Jeff Butler"<[EMAIL PROTECTED]>
The Spring validator would be relatively easy and interesting to do. I suppose
we could infer some basic validation rules too - if a column does not allow
nulls, then write the stub rejectIfEmpty method. I'm not sure what you mean by
the "stub generator" for DAO and models. Could you give an example? Jeff
Butler
On 7/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:Would be a nice feature
e.g. in some future versions
- if there would be a "simple-default" stub (maybe yet mocks) generator for
dao and models
- if there would be a "simple-default" model validation generator e.g for
spring validation
Than it would become a still more fantastic great tool.
(And if it could also reverse engineering onetime from a simple pojo-bean-model
to db
than it would be the ultimate tool)
--
---- weitergeleitete Nachricht Ende ----
--- original Nachricht Ende ----
"Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
http://produkte.shopping.freenet.de/handy_voip_isdn/klarmobil/index.html?pid=730025