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

Hibernate example source code file (Customer.java)

This example Hibernate source code file (Customer.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

arraylist, customer, gregoriancalendar, gregoriancalendar, list, list, math, order, order, string, string, util

The Hibernate Customer.java source code

//$Id: Customer.java 4806 2004-11-25 14:37:00Z steveebersole $
package org.hibernate.test.cid;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;

/**
 * @author Gavin King
 */
public class Customer {
	private String customerId;
	private String name;
	private String address;
	private List orders = new ArrayList();
	/**
	 * @return Returns the address.
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * @param address The address to set.
	 */
	public void setAddress(String address) {
		this.address = address;
	}
	/**
	 * @return Returns the customerId.
	 */
	public String getCustomerId() {
		return customerId;
	}
	/**
	 * @param customerId The customerId to set.
	 */
	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name The name to set.
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return Returns the orders.
	 */
	public List getOrders() {
		return orders;
	}
	/**
	 * @param orders The orders to set.
	 */
	public void setOrders(List orders) {
		this.orders = orders;
	}

	public Order generateNewOrder(BigDecimal total) {
		Order order = new Order(this);
		order.setOrderDate( new GregorianCalendar() );
		order.setTotal( total );

		return order;
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate Customer.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.