I have created a unidirectional m-n relationship as per the example in this
thread:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg05586.html
Here is what I have:
GuarantorBean.java:
===================
/**
* Get all Account's for this Guarantor.
* This is a one (Guarantor) to many (BankAccounts) relationship
* but must be configured as a many-to-many because for
* flexibility's sake in the database, we are using a join table.
* We can get a Collection of BankAccountDto's in the
* GuarantorDto.getBankAccounts() method.
* We can also setBankAccounts( pBankAccounts )
*
* @ejb.interface-method
* view-type="local"
*
* @ejb.value-object
* compose="com.wf.bd.ice.account.BankAccountDto"
* compose-name="BankAccountDto"
* members="com.wf.bd.ice.account.BankAccountLocal"
* members-name="BankAccount"
* relation="external"
* type="java.util.Collection"
*
* @ejb.relation
* name="Guarantor-BankAccount"
* role-name="Guarantor-has-BankAccounts"
* target-ejb="BankAccount"
* target-role-name="BankAccount-has-Guarantors"
* target-multiple="yes"
* --target-cascade-delete="yes"
*
* @weblogic.relation join-table-name="T_ICE_GUARANTORACCOUNT_REL"
*
* @weblogic.column-map
* foreign-key-column="guarantorPK"
* key-column="guarantorPK"
*
* @weblogic.target-column-map
* foreign-key-column="guarantorPK"
* key-column="bankAccountPK"
**/
public abstract Collection getBankAccounts();
/**
* @ejb.interface-method view-type="local"
**/
public abstract void setBankAccounts( Collection pBankAccounts );
T_ICE_GUARANTORACCOUNT:
===========================
guarantorPK
.....(many other fields)...
T_ICE_BANKACCOUNT:
===========================
bankAccountPK
.....(many other fields)...
T_ICE_GUARANTORACCOUNT_REL:
===========================
guarantorPK
bankAccountPK
Here is the runtime error I get when I execute this statement:
Statment:
=============================
...
GuarantorLocal guarantorLocal = guarantorLocalHome.create( guarantor );
...
BankAccountDto[] bankAccounts = guarantors[ i ].getBankAccountDtos();
...
>>ERROR LINE>>> BankAccountLocal bankAccountLocal =
bankAccountLocalHome.create( bankAccounts[ j ] );
...
Error:
==============================
java.lang.ClassCastException
at
com.wf.bd.ice.business.Business_rkoq6y__WebLogic_CMP_RDBMS.__WL_store(Busine
ss_rkoq6y__WebLogic_CMP_RDBMS.java:4712)
at
com.wf.bd.ice.business.Business_rkoq6y__WebLogic_CMP_RDBMS.ejbStore(Business
_rkoq6y__WebLogic_CMP_RDBMS.java:4683)
at
weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
at
weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java
:745)
at
weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInf
o.java:1010)
at
weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCI
nfo.java:115)
at
weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(
ServerTransactionImpl.java:1142)
at
weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerT
ransactionImpl.java:1868)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTra
nsactionImpl.java:250)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransaction
Impl.java:221)
at
weblogic.ejb20.internal.BaseEJBLocalHome.postHomeInvoke(BaseEJBLocalHome.jav
a:321)
at
weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:19
1)
at
com.wf.bd.ice.guarantor.Guarantor_c2m8my_LocalHomeImpl.create(Guarantor_c2m8
my_LocalHomeImpl.java:97)
at
com.wf.bd.ice.creditapplication.CreditApplicationManagerBean.conclude(Credit
ApplicationManagerBean.java:99)
at
com.wf.bd.ice.creditapplication.CreditApplicationManager_9j600a_EOImpl.concl
ude(CreditApplicationManager_9j600a_EOImpl.java:100)
at
com.wf.bd.ice.delegates.CreditApplicationServicesDelegate.conclude(CreditApp
licationServicesDelegate.java:57)
at
com.wf.bd.ice.creditapplication.CreditApplicationActions.conclude(CreditAppl
icationActions.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.
java:252)
at
com.wf.bd.ice.struts.BaseLookupDispatchAction.execute(BaseLookupDispatchActi
on.java:222)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
com.wf.bd.ice.struts.ExtendedActionServlet.process(ExtendedActionServlet.jav
a:44)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user