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

Hibernate example source code file (NotInsertableEntityType.java)

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

audited, basic, entity, id, integer, integer, notinsertableentitytype, notinsertableentitytype, override, override, string, string

The Hibernate NotInsertableEntityType.java source code

package org.hibernate.envers.test.integration.notinsertable.manytoone;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.envers.Audited;

@Entity
@Audited
public class NotInsertableEntityType {
    public NotInsertableEntityType(Integer typeId, String type) {
        this.typeId = typeId;
        this.type = type;
    }

    public NotInsertableEntityType() { }

    @Id
    private Integer typeId;

    @Basic
    private String type;

	public Integer getTypeId() {
		return typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	public String getType() {
		return type;
	}

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

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

		NotInsertableEntityType that = (NotInsertableEntityType) o;

		if (type != null ? !type.equals(that.type) : that.type != null) return false;
		if (typeId != null ? !typeId.equals(that.typeId) : that.typeId != null) return false;

		return true;
	}

	@Override
	public int hashCode() {
		int result = typeId != null ? typeId.hashCode() : 0;
		result = 31 * result + (type != null ? type.hashCode() : 0);
		return result;
	}
}

Other Hibernate examples (source code examples)

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