commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmitch...@apache.org
Subject cvs commit: jakarta-commons-sandbox/resources/contrib/hibernate/src/java/org/apache/commons/resources/impl HibernateBasicMessage.java
Date Sun, 15 Feb 2004 21:40:11 GMT
jmitchell    2004/02/15 13:40:11

  Modified:    resources/contrib/hibernate/src/java/org/apache/commons/resources/impl
                        HibernateBasicMessage.java
  Log:
  Id not needed since Hibernate supports composite key identifiers.
  
  Revision  Changes    Path
  1.2       +14 -21    jakarta-commons-sandbox/resources/contrib/hibernate/src/java/org/apache/commons/resources/impl/HibernateBasicMessage.java
  
  Index: HibernateBasicMessage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/contrib/hibernate/src/java/org/apache/commons/resources/impl/HibernateBasicMessage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HibernateBasicMessage.java	6 Feb 2004 13:26:09 -0000	1.1
  +++ HibernateBasicMessage.java	15 Feb 2004 21:40:11 -0000	1.2
  @@ -62,6 +62,7 @@
   package org.apache.commons.resources.impl;
   
   
  +
   /**
    * BasicMessage to allow standard Hibernate 
    * configuration (no complex keys).
  @@ -81,35 +82,21 @@
        * @param key  The key for this message.
        * @param value The value for this message.
        */
  -    public HibernateBasicMessage(Long id, String locale, String key, Object[] values) {
  +    public HibernateBasicMessage(String locale, String key, Object[] values) {
           super(key, values);
  -        this.id = id;
           this.locale = locale;
           
       }
       
  -    private Long id = null;
       private String locale = null;
   
       /**
  -     * @return Returns the id.
  -     */
  -    public Long getId() {
  -        return id;
  -    }
  -
  -    /**
  -     * @param id The id to set.
  -     */
  -    public void setId(Long id) {
  -        this.id = id;
  -    }
  -    /**
        * @return Returns the locale.
        */
       public String getLocale() {
           return locale;
       }
  +
       /**
        * @param locale The locale to set.
        */
  @@ -135,9 +122,15 @@
           }
           return (String)getValues()[0];
       }
  -
  +    
       public boolean equals(Object obj) {
  -        return super.equals(obj);
  +    	if (obj instanceof HibernateBasicMessage){
  +    		if (((HibernateBasicMessage)obj).getKey().equals(this.key) && 
  +    				((HibernateBasicMessage)obj).getLocale().equals(this.locale)){
  +    			return true;
  +    		}
  +    	}
  +        return false;
       }
   
       public int hashCode() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message