Hello,

I'm having a problem generating relationships where the foreign key field
name is different from the related primary key. The relationships work fine
if both tables have the same column name, but it always uses the column name
of the related entity instead of the alias. Any help would be appreiated.

This from the many side of the relationship

    /**
     * @ejb.interface-method
     *      view-type="local"
     *
     * @ejb.relation
     *      name="Incident-AssignedAgent"
     *      role-name="IncidentAssignedAgent"
     *      target-ejb="User"
     *      target-multiple="yes"
     *
     * @mvcsoft.relation
     *      map-style="foreign-key"
     *      role-with-key="IncidentAssignedAgent"
     *      key-aliases="assignedagent=assignedagent"
     *
     */
    public abstract com.enerlogic.domain.interfaces.UserLocal
getAssignedAgent();

    /**
     * @ejb.interface-method view-type="local"
     * @ejb.transaction type="Required"
     */
    public abstract void
setAssignedAgent(com.enerlogic.domain.interfaces.UserLocal customerContact);


    /**
     * @ejb.interface-method
     *      view-type="local"
     *
     * @ejb.relation
     *      name="Incident-CustomerContact"
     *      role-name="IncidentCustomerContact"
     *      target-ejb="User"
     *      target-multiple="yes"
     *
     * @mvcsoft.relation
     *      map-style="foreign-key"
     *      role-with-key="IncidentCustomerContact"
     *      key-aliases="customerContact=customerContact"
     *
     */
    public abstract com.enerlogic.domain.interfaces.UserLocal
getCustomerContact();

    /**
     * @ejb.interface-method view-type="local"
     * @ejb.transaction type="Required"
     */
    public abstract void
setCustomerContact(com.enerlogic.domain.interfaces.UserLocal
customerContact);



I get the following error from Jboss, appluserid is the primary key of the
users table and doesn't exist in the incident table, the two columns should
be assignedagent and customerContact. This is against a Postgresql database.

2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io] insert into incident
(issuedesc, closedate, createdate, incidentid, applUserID, productID,
applUserID) values (?,?,?,?,?,?,?)
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 1:New Incident
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 2:null
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 3:2003-02-18
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 4:34305
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 5:15665410
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 6:38913
2003-02-18 02:35:51,109 DEBUG [mvcsoft.db.io.param] Param 7:15645441
2003-02-18 02:35:51,125 ERROR [mvcsoft.pm.error] There was an error updating
an entity
java.sql.SQLException: ERROR:  Relation "incident" has no column
"appluserid"

        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
        at
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection
.java:505)
        at
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.j
ava:320)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j
ava:48)
        at
org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1State
ment.java:197)
        at
org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeUpdate(L
ocalPreparedStatement.java:308)
        at com.mvcsoft.pm.bean_behavior.Strategy.storeData(Strategy.java:1039)
        at
com.mvcsoft.pm.bean_behavior.ActionModelAdd.perform(ActionModelAdd.java:25)
        at
com.mvcsoft.pm.bean_behavior.DefaultStorageBehavior.store(DefaultStorageBeha
vior.java:146)
        at
com.mvcsoft.pm.transaction_data.DefaultTransactionData.updatePersistentStore
(DefaultTransactionData.java:207)
        at
com.mvcsoft.pm.transaction_data.DefaultTransactionData.access$000(DefaultTra
nsactionData.java:31)
        at
com.mvcsoft.pm.transaction_data.DefaultTransactionData$PersistenceSynchroniz
ation.beforeCompletion(DefaultTransactionData.java:381)
        at org.jboss.tm.TxCapsule.doBeforeCompletion(TxCapsule.java:1362)
        at org.jboss.tm.TxCapsule.commit(TxCapsule.java:332)
        at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:201)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:13
0)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
        at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
a:313)
        at org.jboss.ejb.Container.invoke(Container.java:720)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
        at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370)
        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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
        at java.lang.Thread.run(Thread.java:536)
2003-02-18 02:35:51,125 ERROR [STDERR] javax.ejb.EJBException: null;
CausedByException is:
        ERROR:  Relation "incident" has no column "appluserid"




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to