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

Hibernate example source code file (Comment.java)

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

calendar, comment, comment, item, item, long, long, string, string, util

The Hibernate Comment.java source code

//$Id: Comment.java 6797 2005-05-16 12:08:03Z oneovthafew $
package org.hibernate.test.joinfetch;
import java.util.Calendar;

/**
 * @author Gavin King
 */
public class Comment {
	
	private String text;
	private Item item;
	private Calendar timestamp;
	private Long id;

	public Item getItem() {
		return item;
	}
	public void setItem(Item item) {
		this.item = item;
	}
	public Calendar getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(Calendar timestamp) {
		this.timestamp = timestamp;
	}
	
	Comment() {}
	public Comment(Item item, String comment) {
		this.text = comment;
		this.item = item;
		item.getComments().add(this);
		this.timestamp = Calendar.getInstance();
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}

}

Other Hibernate examples (source code examples)

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