alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (Customers.java)

This example Hibernate source code file (Customers.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

column, customers, customers, entity, entity, id, io, onetomany, serializable, serializable, table, table

The Hibernate Customers.java source code

//$
package org.hibernate.test.annotations.idmanytoone;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Customers")
@org.hibernate.annotations.Proxy(lazy=false)
public class Customers implements Serializable {

	private static final long serialVersionUID = -885167444315163039L;

	@Column(name="customerID", nullable=false)
	@Id
	private int customerID;

	@OneToMany(mappedBy="owner", cascade= CascadeType.ALL, targetEntity=ShoppingBaskets.class)
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)
	private java.util.Set shoppingBasketses = new java.util.HashSet();

	public void setCustomerID(int value) {
		this.customerID = value;
	}

	public int getCustomerID() {
		return customerID;
	}

	public int getORMID() {
		return getCustomerID();
	}

	public void setShoppingBasketses(java.util.Set value) {
		this.shoppingBasketses = value;
	}

	public java.util.Set getShoppingBasketses() {
		return shoppingBasketses;
	}

}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate Customers.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.