User: vharcq
Date: 02/03/27 00:15:23
Modified: core/samples/src/java/test/ejb AccountBean.java
AddressBean.java CustomerBean.java
Log:
Bring back Value Object to life
Revision Changes Path
1.27 +38 -38 xdoclet/core/samples/src/java/test/ejb/AccountBean.java
Index: AccountBean.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/samples/src/java/test/ejb/AccountBean.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- AccountBean.java 11 Mar 2002 00:23:00 -0000 1.26
+++ AccountBean.java 27 Mar 2002 08:15:23 -0000 1.27
@@ -7,7 +7,7 @@
import test.interfaces.Account;
import test.interfaces.AccountData;
import test.interfaces.Customer;
-//import test.interfaces.AccountValue;
+import test.interfaces.AccountValue;
/**
* This is an account bean. It is an example of how to use the XDoclet tags.
@@ -30,8 +30,8 @@
*
* @ejb:value-object name="Account" match="*" instantiation="eager"
*
- * @version $Revision: 1.26 $
- * @author $Author: stevensa $
+ * @version $Revision: 1.27 $
+ * @author $Author: vharcq $
*/
public abstract class AccountBean implements EntityBean
{
@@ -118,7 +118,7 @@
* @ejb:transaction type="Supports"
* @ejb:value-object match="*" aggregate="test.interfaces.CustomerNormalValue"
aggregate-name="OwnerNormalValue"
*/
- public abstract Customer getOwner();
+ public abstract test.interfaces.Customer getOwner();
/**
* @ejb:value-object match="*" relation="external"
@@ -145,7 +145,7 @@
* Owner of this account.
*
*/
- public abstract void setOwner(Customer owner);
+ public abstract void setOwner(test.interfaces.Customer owner);
/**
* Generated bulk accessor.
@@ -167,39 +167,39 @@
*/
public abstract AccountData getData();
-// /**
-// * @ejb:interface-method view-type="remote"
-// */
-// public abstract AccountValue getAccountValue();
-//
-// /**
-// * @ejb:interface-method view-type="remote"
-// */
-// public abstract void setAccountValue(AccountValue value);
-//
-// /**
-// * Create account.
-// *
-// * @ejb:create-method
-// * @ejb:permission role-name="Administrator"
-// */
-// public Integer ejbCreate(AccountValue data)
-// throws CreateException
-// {
-// setId(data.getId());
-// setAccountValue(data);
-//
-// return null;
-// }
-//
-// /**
-// * Create account.
-// *
-// */
-// public void ejbPostCreate(AccountValue data)
-// throws CreateException
-// {
-// }
+ /**
+ * @ejb:interface-method view-type="remote"
+ */
+ public abstract AccountValue getAccountValue();
+
+ /**
+ * @ejb:interface-method view-type="remote"
+ */
+ public abstract void setAccountValue(AccountValue value);
+
+ /**
+ * Create account.
+ *
+ * @ejb:create-method
+ * @ejb:permission role-name="Administrator"
+ */
+ public Integer ejbCreate(AccountValue data)
+ throws CreateException
+ {
+ setId(data.getId());
+ setAccountValue(data);
+
+ return null;
+ }
+
+ /**
+ * Create account.
+ *
+ */
+ public void ejbPostCreate(AccountValue data)
+ throws CreateException
+ {
+ }
/**
* Transfer money
1.5 +21 -21 xdoclet/core/samples/src/java/test/ejb/AddressBean.java
Index: AddressBean.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/samples/src/java/test/ejb/AddressBean.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- AddressBean.java 11 Mar 2002 00:23:00 -0000 1.4
+++ AddressBean.java 27 Mar 2002 08:15:23 -0000 1.5
@@ -1,10 +1,10 @@
/*
- * $Id: AddressBean.java,v 1.4 2002/03/11 00:23:00 stevensa Exp $
+ * $Id: AddressBean.java,v 1.5 2002/03/27 08:15:23 vharcq Exp $
*/
package test.ejb;
-//import test.interfaces.AddressValue;
import test.interfaces.AddressPK;
+import test.interfaces.AddressValue;
import javax.ejb.EntityBean;
import javax.ejb.CreateException;
@@ -37,24 +37,24 @@
*/
public abstract String getCity();
-// /**
-// * @ejb:interface-method
-// */
-// public abstract AddressValue getAddressValue();
-//
-// /**
-// * @ejb:interface-method
-// */
-// public abstract void setAddressValue(AddressValue v);
-//
-// /**
-// * @ejb:create-method
-// */
-// public AddressPK ejbCreate(AddressValue v)
-// throws CreateException{
-// setId(v.getId());
-// setAddressValue(v);
-// return null;
-// }
+ /**
+ * @ejb:interface-method
+ */
+ public abstract AddressValue getAddressValue();
+
+ /**
+ * @ejb:interface-method
+ */
+ public abstract void setAddressValue(AddressValue v);
+
+ /**
+ * @ejb:create-method
+ */
+ public AddressPK ejbCreate(AddressValue v)
+ throws CreateException{
+ setId(v.getId());
+ setAddressValue(v);
+ return null;
+ }
}
1.38 +33 -41 xdoclet/core/samples/src/java/test/ejb/CustomerBean.java
Index: CustomerBean.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/samples/src/java/test/ejb/CustomerBean.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -w -r1.37 -r1.38
--- CustomerBean.java 25 Mar 2002 23:18:12 -0000 1.37
+++ CustomerBean.java 27 Mar 2002 08:15:23 -0000 1.38
@@ -5,15 +5,7 @@
import javax.ejb.*;
import javax.naming.*;
-import test.interfaces.Customer;
-import test.interfaces.CustomerData;
-import test.interfaces.CustomerPK;
-import test.interfaces.AccountHome;
-//import test.interfaces.CustomerNormalValue;
-//import test.interfaces.CustomerValue;
-import test.interfaces.AddressUtil;
-import test.interfaces.AddressLocalHome;
-import test.interfaces.AddressLocal;
+import test.interfaces.*;
/**
* This is a customer bean. It is an example of how to use the XDoclet tags.
@@ -125,8 +117,8 @@
*
* @ejb:interface-method
*/
-// public abstract void addAccount(test.interfaces.AccountValue added)
-// throws javax.ejb.CreateException;
+ public abstract void addAccount(test.interfaces.AccountValue added)
+ throws javax.ejb.CreateException;
/**
@@ -149,12 +141,12 @@
/**
* @ejb:interface-method view-type="remote"
*/
- //public abstract void setCustomerNormalValue(CustomerNormalValue value);
+ public abstract void setCustomerNormalValue(CustomerNormalValue value);
/**
* @ejb:interface-method view-type="remote"
*/
- //public abstract CustomerNormalValue getCustomerNormalValue();
+ public abstract CustomerNormalValue getCustomerNormalValue();
/**
* Generated bulk accessor.
@@ -206,34 +198,34 @@
}
}
-// /**
-// * Create customer.
-// *
-// * @ejb:create-method
-// * @ejb:permission role-name="Administrator"
-// */
-// public java.lang.Object ejbCreate(CustomerNormalValue data)
-// throws CreateException
-// {
-// try{
-// setId(data.getId());
-// data.getAddressValue().setId(data.getId());
-// AddressUtil.getLocalHome().create(data.getAddressValue());
-// return null;
-// }catch (Exception e){
-// throw new EJBException(e);
-// }
-// }
-//
-// /**
-// * Post create for create customer.
-// *
-// * @see #ejbCreate(CustomerNormalValue)
-// */
-// public void ejbPostCreate(CustomerNormalValue data)
-// throws CreateException
-// {
-// }
+ /**
+ * Create customer.
+ *
+ * @ejb:create-method
+ * @ejb:permission role-name="Administrator"
+ */
+ public java.lang.Object ejbCreate(CustomerNormalValue data)
+ throws CreateException
+ {
+ try{
+ setId(data.getId());
+ data.getAddressValue().setId(data.getId());
+ AddressUtil.getLocalHome().create(data.getAddressValue());
+ return null;
+ }catch (Exception e){
+ throw new EJBException(e);
+ }
+ }
+
+ /**
+ * Post create for create customer.
+ *
+ * @see #ejbCreate(CustomerNormalValue)
+ */
+ public void ejbPostCreate(CustomerNormalValue data)
+ throws CreateException
+ {
+ }
/**
* Create customer.
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel