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

Hibernate example source code file (StudentDTO.java)

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

personname, personname, string, string, studentdto, studentdto

The Hibernate StudentDTO.java source code

/*
 * Created on 28-Jan-2005
 *
 */
package org.hibernate.test.querycache;


/**
 * @author max
 *
 */
public class StudentDTO {

	private PersonName studentName;
	private String courseDescription;

	public StudentDTO() { }

	public StudentDTO(PersonName name) {
		this.studentName = name;
	}

	public StudentDTO(PersonName name, String description) {
		this.studentName = name;
		this.courseDescription = description;
	}

	public PersonName getName() {
		return studentName;
	}

	public String getDescription() {
		return courseDescription;
	}

	public boolean equals(Object o) {
		if ( this == o ) {
			return true;
		}
		if ( o == null || getClass() != o.getClass() ) {
			return false;
		}

		StudentDTO that = ( StudentDTO ) o;

		if ( courseDescription != null ? !courseDescription.equals( that.courseDescription ) : that.courseDescription != null ) {
			return false;
		}
		if ( studentName != null ? !studentName.equals( that.studentName ) : that.studentName != null ) {
			return false;
		}

		return true;
	}

	public int hashCode() {
		int result = studentName != null ? studentName.hashCode() : 0;
		result = 31 * result + ( courseDescription != null ? courseDescription.hashCode() : 0 );
		return result;
	}
}

Other Hibernate examples (source code examples)

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