|
Hibernate example source code file (StoreCustomer.java)
The Hibernate StoreCustomer.java source code//$Id$ package org.hibernate.test.annotations.idmanytoone; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * @author Emmanuel Bernard */ @Entity @Table(name = "ABs") @IdClass( StoreCustomerPK.class) public class StoreCustomer implements Serializable { StoreCustomer() {} @Id @ManyToOne(optional = false) @JoinColumn(name = "idA") public Store store; @Id @ManyToOne(optional = false) @JoinColumn(name = "idB") public Customer customer; public StoreCustomer(Store store, Customer customer) { this.store = store; this.customer = customer; } private static final long serialVersionUID = -8295955012787627232L; } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate StoreCustomer.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.