]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Assurance.java
Move the "dbObject"s to their own package.
[gigi.git] / src / org / cacert / gigi / dbObjects / Assurance.java
diff --git a/src/org/cacert/gigi/dbObjects/Assurance.java b/src/org/cacert/gigi/dbObjects/Assurance.java
new file mode 100644 (file)
index 0000000..b1c9ccd
--- /dev/null
@@ -0,0 +1,61 @@
+package org.cacert.gigi.dbObjects;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+
+public class Assurance {
+    private int id;
+
+    private User from;
+
+    private User to;
+
+    private String location;
+
+    private String method;
+
+    private int points;
+
+    private String date;
+
+    public Assurance(ResultSet result) throws SQLException {
+        super();
+        this.id = result.getInt("id");
+        this.from = User.getById(result.getInt("from"));
+        this.to = User.getById(result.getInt("to"));
+        this.location = result.getString("location");
+        this.method = result.getString("method");
+        this.points = result.getInt("points");
+        this.date = result.getString("date");
+    }
+
+    public User getFrom() {
+        return from;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public int getPoints() {
+        return points;
+    }
+
+    public User getTo() {
+        return to;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+}