-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now we serialize all session's attributes as an array of bytes. All s…
…ession's attributes have to be serializable in order to be saved to the database properly.
- Loading branch information
Showing
5 changed files
with
142 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/test/java/io/github/maseev/spring/session/orientdb/entity/Person.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package io.github.maseev.spring.session.orientdb.entity; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Person implements Serializable { | ||
|
||
private String name; | ||
private int age; | ||
|
||
public Person() { | ||
} | ||
|
||
public Person(final String name, final int age) { | ||
this.name = name; | ||
this.age = age; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(int age) { | ||
this.age = age; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
if (!(o instanceof Person)) { | ||
return false; | ||
} | ||
|
||
Person person = (Person) o; | ||
|
||
if (age != person.age) { | ||
return false; | ||
} | ||
|
||
return name.equals(person.name); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = name.hashCode(); | ||
result = 31 * result + age; | ||
return result; | ||
} | ||
} |