-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add classes for mapping test purposes
Signed-off-by: Maximillian Arruda <dearrudam@gmail.com>
- Loading branch information
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
jnosql-dynamodb/src/test/java/org/eclipse/jnosql/databases/dynamodb/mapping/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,82 @@ | ||
/* | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* and Apache License v2.0 which accompanies this distribution. | ||
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html | ||
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. | ||
* | ||
* You may elect to redistribute this code under either of these licenses. | ||
* | ||
* Contributors: | ||
* | ||
* Maximillian Arruda | ||
*/ | ||
|
||
package org.eclipse.jnosql.databases.dynamodb.mapping; | ||
|
||
import jakarta.nosql.Entity; | ||
import jakarta.nosql.Id; | ||
import jakarta.nosql.Column; | ||
|
||
import java.util.Objects; | ||
|
||
@Entity | ||
public class Person { | ||
|
||
@Id | ||
private String name; | ||
|
||
@Column | ||
private Integer age; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Integer getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(Integer age) { | ||
this.age = age; | ||
} | ||
|
||
public Person(String name, Integer age) { | ||
this.name = name; | ||
this.age = age; | ||
} | ||
|
||
public Person() { | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Person person = (Person) o; | ||
return Objects.equals(name, person.name) && | ||
Objects.equals(age, person.age); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(name, age); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Person{" + | ||
"name='" + name + '\'' + | ||
", age=" + age + | ||
'}'; | ||
} | ||
|
||
public static Person of(String name, Integer age) { | ||
return new Person(name, age); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...db/src/test/java/org/eclipse/jnosql/databases/dynamodb/mapping/PersonNoSQLRepository.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,22 @@ | ||
/* | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* and Apache License v2.0 which accompanies this distribution. | ||
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html | ||
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. | ||
* | ||
* You may elect to redistribute this code under either of these licenses. | ||
* | ||
* Contributors: | ||
* | ||
* Maximillian Arruda | ||
*/ | ||
|
||
package org.eclipse.jnosql.databases.dynamodb.mapping; | ||
|
||
import jakarta.data.repository.Repository; | ||
|
||
@Repository | ||
public interface PersonNoSQLRepository extends DynamoDBRepository<Person, String> { | ||
} |