]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/CertificateOwner.java
Merge "upd: remove alert settings from register process"
[gigi.git] / src / club / wpia / gigi / dbObjects / CertificateOwner.java
index 1c7cdb4a2e2a2109cda94bb566b58f8f8c84e7b1..007d98d3a1092c7d5401c9ba3014f0e676f62bef 100644 (file)
@@ -24,7 +24,15 @@ public abstract class CertificateOwner implements IdCachable, Serializable {
         this.id = id;
     }
 
-    protected CertificateOwner() {
+    /**
+     * This constructor has a dummy parameter to allow callers to do checks
+     * before invoking the super constructor.
+     * 
+     * @param dummy
+     *            a parameter that is not used to allow callers to do checks
+     *            before super constructor invocation.
+     */
+    protected CertificateOwner(Void dummy) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `certOwners` DEFAULT VALUES")) {
             ps.execute();
             id = ps.lastInsertId();
@@ -83,7 +91,7 @@ public abstract class CertificateOwner implements IdCachable, Serializable {
     }
 
     public Certificate[] getCertificates(boolean includeRevoked) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement(includeRevoked ? "SELECT id FROM certs WHERE memid=? ORDER BY id DESC" : "SELECT id FROM certs WHERE memid=? AND revoked IS NULL ORDER BY id DESC")) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement(includeRevoked ? "SELECT id FROM certs WHERE memid=? ORDER BY id DESC" : "SELECT id FROM certs WHERE memid=? AND `revoked` IS NULL ORDER BY id DESC")) {
             ps.setInt(1, getId());
 
             GigiResultSet rs = ps.executeQuery();