Java tutorial
/* * Copyright 2012 Eng Kam Hon (kamhon@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.kamhon.ieagle.function.language.vo; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.Table; import net.kamhon.ieagle.vo.annotation.ToTrim; import net.kamhon.ieagle.vo.annotation.ToUpperCase; import org.apache.commons.lang.builder.HashCodeBuilder; @Entity @Table(name = "app_language_res") @Access(AccessType.FIELD) public class LanguageRes extends net.kamhon.ieagle.vo.VoBase { private static final long serialVersionUID = 1L; @EmbeddedId private LanguageResKey id = new LanguageResKey(); @ToTrim @ToUpperCase @Column(name = "res_value") private String resValue; public LanguageRes() { } public LanguageRes(LanguageResKey id) { this.id = id; } public LanguageRes(boolean defaultValue) { if (defaultValue) { } } public LanguageResKey getId() { return id; } public String getResValue() { return resValue; } public void setId(LanguageResKey id) { this.id = id; } public void setResValue(String resValue) { this.resValue = resValue; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final LanguageRes other = (LanguageRes) obj; if (this.id == null) { if (other.id != null) return false; } else if (!this.id.equals(other.id)) return false; return true; } public int hashCode() { HashCodeBuilder hashCode = new HashCodeBuilder(); hashCode.append(id); return hashCode.toHashCode(); } }