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

Hibernate example source code file (Contract.java)

This example Hibernate source code file (Contract.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, contract, contract, hashset, hashset, io, list, serializable, set, set, string, string, util

The Hibernate Contract.java source code

//$Id: Contract.java 7222 2005-06-19 17:22:01Z oneovthafew $
package org.hibernate.test.immutable;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Contract implements Serializable {
	
	private long id;
	private long version;
	private String customerName;
	private String type;
	private List variations;
	private Contract parent;
	private Set subcontracts;
	private Set plans;
	private Set parties;
	private Set infos;

	public Contract() {
		super();
	}

	public Contract(Plan plan, String customerName, String type) {
		plans = new HashSet();
		if ( plan != null ) {
			plans.add( plan );
			plan.getContracts().add( this );
		}
		this.customerName = customerName;
		this.type = type;
		variations = new ArrayList();
		subcontracts = new HashSet();
		parties = new HashSet();
		infos = new HashSet();
	}

	public long getVersion() {
		return version;
	}

	public void setVersion(long version) {
		this.version = version;
	}
	
	public Set getPlans() {
		return plans;
	}

	public void setPlans(Set plans) {
		this.plans = plans;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public List getVariations() {
		return variations;
	}

	public void setVariations(List variations) {
		this.variations = variations;
	}

	public Contract getParent() {
		return parent;
	}

	public void setParent(Contract parent) {
		this.parent = parent;
	}

	public Set getSubcontracts() {
		return subcontracts;
	}

	public void setSubcontracts(Set subcontracts) {
		this.subcontracts = subcontracts;
	}

	public void addSubcontract(Contract subcontract) {
		subcontracts.add( subcontract );
		subcontract.setParent( this );
	}

	public Set getParties() {
		return parties;
	}

	public void setParties(Set parties) {
		this.parties = parties;
	}

	public void addParty(Party party) {
		parties.add( party );
		party.setContract( this );
	}

	public void removeParty(Party party) {
		parties.remove( party );
		party.setContract( null );
	}

	public Set getInfos() {
		return infos;
	}

	public void setInfos(Set infos) {
		this.infos = infos;
	}
}

Other Hibernate examples (source code examples)

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