|
Hibernate example source code file (Vegetable.java)
The Hibernate Vegetable.java source code//$Id$ package org.hibernate.test.annotations.inheritance; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; /** * @author Emmanuel Bernard */ @Entity() @Inheritance( strategy = InheritanceType.JOINED ) public class Vegetable { private VegetablePk id; private long priceInCent; @Id public VegetablePk getId() { return id; } public void setId(VegetablePk id) { this.id = id; } public long getPriceInCent() { return priceInCent; } public void setPriceInCent(long priceInCent) { this.priceInCent = priceInCent; } public boolean equals(Object o) { if ( this == o ) return true; if ( !( o instanceof Vegetable ) ) return false; final Vegetable vegetable = (Vegetable) o; if ( !id.equals( vegetable.id ) ) return false; return true; } public int hashCode() { return id.hashCode(); } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Vegetable.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.