Skip to content

Commit

Permalink
#107 add hashcode for entity and enable SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
mincong-h committed Jul 24, 2016
1 parent 981a371 commit 13c8bd4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Expand Up @@ -57,4 +57,33 @@ public String getName() {
public void setName(String name) {
this.name = name;
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result + ( ( name == null ) ? 0 : name.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;
Company other = (Company) obj;
if ( id != other.id )
return false;
if ( name == null ) {
if ( other.name != null )
return false;
}
else if ( !name.equals( other.name ) )
return false;
return true;
}
}
Expand Up @@ -14,8 +14,8 @@
<class>org.hibernate.search.jsr352.test.entity.MyDate</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.connection.release_mode" value="on_close" />
<property name="hibernate.search.default.directory_provider" value="ram" />
Expand Down

0 comments on commit 13c8bd4

Please sign in to comment.