/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.datastore.neo4j.test.transaction;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* @author Davide D'Alto
*/
@Entity
public class Game implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
private String title;
public Game() {
}
public Game(String id, String title) {
this.id = id;
this.title = title;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ( ( title == null ) ? 0 : title.hashCode() );
return result;
}
@Override
public boolean equals(Object obj) {
if ( this == obj ) {
return true;
}
if ( obj == null ) {
return false;
}
if ( getClass() != obj.getClass() ) {
return false;
}
Game other = (Game) obj;
if ( title == null ) {
if ( other.title != null ) {
return false;
}
}
else if ( !title.equals( other.title ) ) {
return false;
}
return true;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append( "[" );
builder.append( id );
builder.append( ", " );
builder.append( title );
builder.append( "]" );
return builder.toString();
}
}