|
Hibernate example source code file (RegionalArticlePk.java)
The Hibernate RegionalArticlePk.java source code//$Id$ package org.hibernate.test.annotations.embedded; import java.io.Serializable; import javax.persistence.Embeddable; import org.hibernate.annotations.AccessType; /** * Regional article pk * * @author Emmanuel Bernard */ @Embeddable @AccessType("field") public class RegionalArticlePk implements Serializable { /** * country iso2 code */ public String iso2; public String localUniqueKey; public int hashCode() { //this implem sucks return ( iso2 + localUniqueKey ).hashCode(); } public boolean equals(Object obj) { //iso2 and localUniqueKey are expected to be set in this implem if ( obj != null && obj instanceof RegionalArticlePk ) { RegionalArticlePk other = (RegionalArticlePk) obj; return iso2.equals( other.iso2 ) && localUniqueKey.equals( other.localUniqueKey ); } else { return false; } } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate RegionalArticlePk.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.