|
Hibernate example source code file (Mammal.java)
The Hibernate Mammal.java source code//$Id: Mammal.java 6005 2005-03-04 11:41:11Z oneovthafew $ package org.hibernate.test.hql; import java.util.Date; /** * @author Gavin King */ public class Mammal extends Animal { private boolean pregnant; private Date birthdate; public boolean isPregnant() { return pregnant; } public void setPregnant(boolean pregnant) { this.pregnant = pregnant; } public Date getBirthdate() { return birthdate; } public void setBirthdate(Date birthdate) { this.birthdate = birthdate; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( !( o instanceof Mammal ) ) { return false; } Mammal mammal = ( Mammal ) o; if ( pregnant != mammal.pregnant ) { return false; } if ( birthdate != null ? !birthdate.equals( mammal.birthdate ) : mammal.birthdate != null ) { return false; } return true; } @Override public int hashCode() { int result = ( pregnant ? 1 : 0 ); result = 31 * result + ( birthdate != null ? birthdate.hashCode() : 0 ); return result; } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Mammal.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.