Message:

   The following issue has been re-assigned.

   Assignee: Paul Galbraith (mailto:[EMAIL PROTECTED])
---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-910

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-910
    Summary: composite id fails when i put an interface
       Type: Bug

     Status: Open
   Priority: Critical

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             Hibernate Module
   Versions:
             1.2.1

   Assignee: Paul Galbraith
   Reporter: Horacio

    Created: Sat, 22 May 2004 10:02 AM
    Updated: Wed, 20 Apr 2005 11:14 AM
Environment:  Debian Linux SID (unstable)
j2sdk 1.4.2_04
xdoclet 1.2.1
maven-1.1-SNAPSHOT

Description:
I posted this bug two days ago describing this bug, but i couldn't make myself 
clear.
So, I've decided to describe the problem with the actual classes that I'm using.

/****************************************************************/
public interface IPrimaryKey extends Serializable
{

        public boolean equals(Object o);
}



/****************************************************************/
* I have an abstract class like this..: 


public abstract class AbstractEntityStoreable implements IEntityStoreable,
        IAuditable
{

    private transient Logger log = Logger
            .getLogger(AbstractEntityStoreable.class.getName());

    protected IPrimaryKey pkReal;

    protected IAudit audit;


    public AbstractEntityStoreable()
    {
        this(null);
        
    }

    protected abstract  IPrimaryKey createPrimaryKey();
    
    public AbstractEntityStoreable(IPrimaryKey pk)
    {
        this(pk, new Audit());
    }

    public AbstractEntityStoreable(IPrimaryKey pk, IAudit audit)
    {
        if (pk == null)
            pkReal = createPrimaryKey();
        else
            pkReal = null;
        
        setAudit(audit);

    }

    public final void delete() throws ObjectNotFoundException, 
PersistenceException
    {

       
    }
    
    public void deleteRep(IStoreRepository repo) throws 
ObjectNotFoundException, PersistenceException
    {
        
    }


    protected void postDelete() throws PersistenceException
    {

    }

    protected void preDelete() throws PersistenceException
    {

    }

    protected void validateDelete() throws ValidationException
    {

    }

    public final void store() throws BFCStoreException
        {
        }
    
        protected void postStore() 
        {
            
        }
    
        protected void preStore()
        {
            
        }
    
        protected void validateStore() throws ValidationException
        {
            
        }

    public void save() throws ObjectAlreadyExistsException, PersistenceException
    {
    }
    
    public void saveRep(IStoreRepository repo) throws 
ObjectAlreadyExistsException, PersistenceException
    {

    }

    protected void postSave() throws PersistenceException
    {

    }

    protected void preSave() throws PersistenceException
    {

    }

    protected void validateSave() throws ValidationException
    {

    }

    public void update() throws ObjectNotFoundException, PersistenceException
    {

    }

    public void updateRep(IStoreRepository repo) throws PersistenceException
    {

    }

    protected void postUpdate() throws PersistenceException
    {

    }

    protected void preUpdate() throws PersistenceException
    {

    }

    protected void validateUpdate() throws ValidationException
    {

    }

    public IPrimaryKey getPk()
    {
          return pkReal;
    }

    public void setPk(IPrimaryKey pkReal)
    {
        this.pkReal = pkReal;
    }

    public void setPkReal(IPrimaryKey pkReal)
    {
        this.pkReal = pkReal;
    }
    
    public IEntityStoreable load(IPrimaryKey primaryKey)
            throws PersistenceException, ObjectNotFoundException
    {
        
    }
    
    
    public IEntityStoreable loadRep(IPrimaryKey primaryKey, IStoreRepository 
repo)  throws PersistenceException, ObjectNotFoundException
        {

        }


    public List find(IFinding finding) throws PersistenceException
    {

    }
    
    
    public List findRep(IFinding finding, IStoreRepository repo) throws 
PersistenceException
    {
        
    }

    private QueryTree getQueryTree(IFinding pFinding)
            throws PersistenceException
    {
        
    }

    public IAudit getAudit()
    {
        return this.audit;
    }

    public void setAudit(IAudit pAudit)
    {
        this.audit = pAudit;

    }
    
    protected transient IStoreRepository repoUnique;
    
    private synchronized IStoreRepository initRepository() throws 
PersistenceException
    {   

        
    }

    
    private synchronized void closeRepository(IStoreRepository repository) 
throws PersistenceException
    {
    
    }

}



/******************************************************************/

* And also this abstract class which inherits from the precedent class.:


public abstract class ServiceBusiness extends AbstractEntityStoreable 
implements IEntity, IServiceBusiness, java.io.Serializable 
{
        private String alias;
        private String titular;
        
       /**
         * @hibernate.property column="txt_alias"
         */
        public String getAlias() {
        return alias;
        }
        public void setAlias(String newAlias) {
                alias = newAlias;
        }
        /**
         * @hibernate.property column="txt_titular"
         */
        public String getTitular() {
                //TODO que es esto?
                //titular.replace('\'','?'); 
            return titular;
        }
        public void setTitular(java.lang.String newTitular) {
                titular = newTitular;
        }
}


/*******************************************************************/

* Also a class inherits from ServiceBusiness:


/**
 * @hibernate.class
 *                      table="inv_contratos"
 * 
 */
public class AccessBusiness extends ServiceBusiness implements IAccessBusiness {
        
    
        private String identificationCode;
        private String email;
        private String password;
        private String signature;
        private Boolean passwordIndicator;
        private Boolean signatureIndicator;
        private Timestamp lastAccess;
        private String nifCode;
        private String institution;
        private Integer intents;
        private Set accounts;
        
        
                        
        public String getEmail() {
                return email;
        }
        public void setEmail(String email) {
                this.email = email;
        }
        public String getIdentificationCode() {
                return identificationCode;
        }
        public void setIdentificationCode(String identificationCode) {
                this.identificationCode = identificationCode;
        }
        /**
         * @hibernate.property column="cod_institucion"
         */
        public String getInstitution() {
                return institution;
        }
        public void setInstitution(String institution) {
                this.institution = institution;
        }
        /**
         * @hibernate.property column="num_intentos"
         */
        public Integer getIntents() {
                return intents;
        }
        public void setIntents(Integer intents) {
                this.intents = intents;
        }
        /**
         * @hibernate.property column="fec_ult_ent"
         */
        public Timestamp getLastAccess() {
                return lastAccess;
        }
        public void setLastAccess(Timestamp lastAccess) {
                this.lastAccess = lastAccess;
        }
        /**
         * @hibernate.property column="cod_nif"
         */
        public String getNifCode() {
                return nifCode;
        }
        public void setNifCode(String nifCode) {
                this.nifCode = nifCode;
        }
        /**
         * @hibernate.property column="cod_password"
         */
        public String getPassword() {
                return password;
        }
        public void setPassword(String password) {
                this.password = password;
        }
        /**
         * @hibernate.property column="flg_pass"
         */
        public Boolean getPasswordIndicator() {
                return passwordIndicator;
        }
        public void setPasswordIndicator(Boolean passwordIndicator) {
                this.passwordIndicator = passwordIndicator;
        }
        /**
         * @hibernate.property column="cod_firma"
         */
        public String getSignature() {
                return signature;
        }
        public void setSignature(String signature) {
                this.signature = signature;
        }
        /**
         * @hibernate.property column="flg_firma"
         */
        public Boolean getSignatureIndicator() {
                return signatureIndicator;
        }
        public void setSignatureIndicator(Boolean signatureIndicator) {
                this.signatureIndicator = signatureIndicator;
        }
        
        /**
         * @hibernate.set role="cuentas" lazy="true" inverse="true"
         * 
         * @hibernate.collection-key
         * @hibernate.collection-key-column name="cod_empresa"
     * @hibernate.collection-key-column name="cod_sucursal"
     * @hibernate.collection-one-to-many 
class="net.technisys.bancoval.cockpit.domain.accountaccess.AccountAccessBusiness"
         */
        public Set getAccounts() {
                return accounts;
        }
        public void setAccounts(Set accounts) {
                this.accounts = accounts;
        }
        
        /** 
          * @hibernate.id
          *             
generator-class="net.technisys.bancoval.cockpit.domain.access.AccessPrimaryKey"
     */
        public IPrimaryKey getPkReal() {
        return this.getPk();
    }
    
    protected void setPkReal(AccessPrimaryKey pk) {
        this.setPk(pk);
    }
    
    
    public Properties regeneratePasswordSignature() throws DomainException, 
ObjectNotFoundException, BFCStoreException
    {
        
        
    
    }
    
    public Properties givePasswordSignature() throws DomainException, 
ObjectNotFoundException, BFCStoreException
    {
        
        }

    public AccessBusiness loadByAccess(String company, String accessNumber) 
throws DomainException, ObjectNotFoundException
    {
    
    }
    
    
    public Map copiarContrato() throws Exception
    {

    }
    protected IPrimaryKey createPrimaryKey()
    {
        return new AccessPrimaryKey();
    }

}

/**************************************************************/

* This is the associated primary key of AccessBusiness class.:


public class AccessPrimaryKey implements IPrimaryKey {
        private String company;
        private String accessNumber;
        
        public AccessPrimaryKey() 
        {

        }
        public AccessPrimaryKey(String newCompany, String newAccessNumber) {
        }
        
        /**
         * @hibernate.property column="num_contrato"
         */
        public String getAccessNumber() {
                return accessNumber;
        }
        public void setAccessNumber(java.lang.String accessNumber) {
                this.accessNumber = accessNumber;
        }
        /**
         * @hibernate.property column="cod_empresa"
         */
        public String getCompany() {
                return company;
        }
        public void setCompany(java.lang.String company) {
                this.company = company;
        }
        
    public String toString()
    {
        
    }

        public boolean equals(Object o) {
                if (this == o) {                        
                        return true;
                }
                if (o == null) {
                        System.out.println("Not equals");
                        return false;
                }
                if (o.getClass() != getClass()) {
                        return false;
                }
                AccessPrimaryKey castedObj = (AccessPrimaryKey) o;
                return ((this.company == null
                        ? castedObj.company == null
                        : this.company.equals(castedObj.company)) && 
(this.accessNumber == null
                        ? castedObj.accessNumber == null
                        : this.accessNumber.equals(castedObj.accessNumber)));
        }
}


/******************************************************************/

When xdoclet parses class AccessBusiness the following error message appears:

Running XDoclet failed.
<<Composite ID property of type IPrimaryKey is invalid. It has to be 
serializable and reimplement equals(Object)>>
XDoclet failed.
        at xdoclet.DocletTask.start(DocletTask.java:465)
        at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:110)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at 
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:78)
        at 
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:99)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
        at 
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:531)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265)
        at org.apache.maven.cli.App.doMain(App.java:466)
        at org.apache.maven.cli.App.main(App.java:1117)
        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 com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)


/***********************************************/ 

I expect I have described the problem properly.


I would be grateful if someone can help me, i really need this getting solved. 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to