Commit 52d66bf7 authored by Santi's avatar Santi

Modified datasets to add, delete and modify

parent 1498a048
......@@ -5,10 +5,11 @@ import es.uvigo.esei.daa.entities.Pet;
import static java.util.Arrays.stream;
public final class PetsDataset {
private PetsDataset() {}
private PetsDataset() {
}
public static Pet[] pets() {
return new Pet[] {
return new Pet[]{
new Pet(1, 1, "Tom"),
new Pet(2, 1, "Jerry")
};
......@@ -21,6 +22,7 @@ public final class PetsDataset {
.findAny()
.orElseThrow(IllegalArgumentException::new);
}
public static int existentId() {
return 1;
}
......@@ -29,4 +31,14 @@ public final class PetsDataset {
return pet(existentId());
}
public static String newName() { return "Nibbles";}
public static int newOwner() {
return 2;
}
public static Pet newPet() {
return new Pet(pets().length + 1, newOwner(), newName());
}
}
......@@ -14,6 +14,11 @@
<people id="10" name="Juan" surname="Jiménez" />
<people id="11" name="John" surname="Doe" />
<pets id="1" owner="1" name="Tom"/>
<pets id="2" owner="1" name="Jerry"/>
<pets id="3" owner="2" name="Nibbles"/>
<users login="admin" password="713bfda78870bf9d1b261f565286f85e97ee614efe5f0faf7c34e7ca4f65baca" role="ADMIN"/>
<users login="normal" password="7bf24d6ca2242430343ab7e3efb89559a47784eea1123be989c1b2fb2ef66e83" role="USER" />
</dataset>
\ No newline at end of file
......@@ -12,6 +12,8 @@
<people id="9" name="Julia" surname="Justa" />
<people id="10" name="Juan" surname="Jiménez" />
<pets id="2" owner="1" name="Jerry"/>
<users login="admin" password="713bfda78870bf9d1b261f565286f85e97ee614efe5f0faf7c34e7ca4f65baca" role="ADMIN"/>
<users login="normal" password="7bf24d6ca2242430343ab7e3efb89559a47784eea1123be989c1b2fb2ef66e83" role="USER" />
</dataset>
\ No newline at end of file
......@@ -13,6 +13,10 @@
<people id="9" name="Julia" surname="Justa" />
<people id="10" name="Juan" surname="Jiménez" />
<pets id="1" owner="2" name="Nibbles"/>
<pets id="2" owner="1" name="Jerry"/>
<users login="admin" password="713bfda78870bf9d1b261f565286f85e97ee614efe5f0faf7c34e7ca4f65baca" role="ADMIN"/>
<users login="normal" password="7bf24d6ca2242430343ab7e3efb89559a47784eea1123be989c1b2fb2ef66e83" role="USER" />
</dataset>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment