com.github.mrstampy.hit.example.Hit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hit-example Show documentation
Show all versions of hit-example Show documentation
Hibernate Induction Trigger - Example Code
/*
* HIT - Hibernate Induction Trigger - A Hibernate Quickstart Library
*
* Copyright (C) 2014 Burton Alexander
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
package com.github.mrstampy.hit.example;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.github.mrstampy.hit.entity.AbstractEntity;
/**
* HIT example entity class. This class maps to a table called 'hit' in a
* database called 'hit'. It contains 3 properties, an auto generated primary
* key, a string and a boolean.
*
* @author burton
*
*/
@Entity
@Table(name = "hit", schema = "hit")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Hit extends AbstractEntity {
private static final long serialVersionUID = -5867494274708524421L;
private int id;
private String value;
private boolean awesome;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public boolean isAwesome() {
return awesome;
}
public void setAwesome(boolean awesome) {
this.awesome = awesome;
}
}