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

Hibernate example source code file (Category.java)

This example Hibernate source code file (Category.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, assignable, assignable, category, list, list, root_category, root_id, root_id, string, string, util

The Hibernate Category.java source code

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

/**
 *
 */
public class Category {
	
	public static final String ROOT_CATEGORY = "/";
	public static final int ROOT_ID = 42;

	private long id;
	private String name;
	private List subcategories = new ArrayList();
	private Assignable assignable;
	/**
	 * Returns the id.
	 * @return long
	 */
	public long getId() {
		return id;
	}
	
	/**
	 * Sets the id.
	 * @param id The id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	
	/**
	 * Returns the subcategories.
	 * @return List
	 */
	public List getSubcategories() {
		return subcategories;
	}
	
	/**
	 * Sets the subcategories.
	 * @param subcategories The subcategories to set
	 */
	public void setSubcategories(List subcategories) {
		this.subcategories = subcategories;
	}
	
	/**
	 * Returns the name.
	 * @return String
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Sets the name.
	 * @param name The name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	public Assignable getAssignable() {
		return assignable;
	}

	public void setAssignable(Assignable assignable) {
		this.assignable = assignable;
	}
	
	public String toString() {
		return id + ":" + name;
	}

}






Other Hibernate examples (source code examples)

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