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

Hibernate example source code file (Employee.java)

This example Hibernate source code file (Employee.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, collection, collection, employee, employee, person, person, string, string, util

The Hibernate Employee.java source code

//$Id: Employee.java 5686 2005-02-12 07:27:32Z steveebersole $
package org.hibernate.test.lazyonetoone;
import java.util.ArrayList;
import java.util.Collection;

/**
 * @author Gavin King
 */
public class Employee {
	private String personName;
	private Person person;
	private Collection employments = new ArrayList(); 
	Employee() {}
	public Employee(Person p) {
		this.person = p;
		this.personName = p.getName();
		p.setEmployee(this);
	}
	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
	public String getPersonName() {
		return personName;
	}
	public void setPersonName(String personName) {
		this.personName = personName;
	}
	public Collection getEmployments() {
		return employments;
	}
	public void setEmployments(Collection employments) {
		this.employments = employments;
	}
}

Other Hibernate examples (source code examples)

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