|
Hibernate example source code file (CustomerInventoryPK.java)
The Hibernate CustomerInventoryPK.java source codepackage org.hibernate.test.annotations.derivedidentities.e1.b2; import java.io.Serializable; public class CustomerInventoryPK implements Serializable { private Integer id; private Customer customer; public CustomerInventoryPK() { } public CustomerInventoryPK(Integer id, Customer customer) { this.id = id; this.customer = customer; } public boolean equals(Object other) { if ( other == this ) { return true; } if ( other == null || getClass() != other.getClass() ) { return false; } CustomerInventoryPK cip = ( CustomerInventoryPK ) other; return ( getCustomer().getId() == cip.getCustomer().getId() && ( id == cip.id || ( id != null && id.equals( cip.id ) ) ) ); } public int hashCode() { return ( id == null ? 0 : id.hashCode() ) ^ getCustomer().getId(); } public Integer getId() { return id; } public Customer getCustomer() { return customer; } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate CustomerInventoryPK.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.