(no commit message)
[utils] / security / impl / src / main / java / org / wamblee / security / authorization / PathCondition.java
index 4e03953f7803ac59b7c6769564bf7d7cdf2f2483..b1c6670a932dcdf4f51a1a79c8e4eab358db6c0d 100644 (file)
  */ 
 package org.wamblee.security.authorization;
 
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
 import org.wamblee.persistence.Persistent;
 
 /**
@@ -22,7 +32,28 @@ import org.wamblee.persistence.Persistent;
  * 
  * @author Erik Brakkee
  */
-public interface PathCondition extends Persistent {
+@Entity
+@Table(name = "SEC_PATH_CONDITION")
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name = "TYPE")
+public abstract class PathCondition {
+    
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private Long primaryKey;
+
+    @Version
+    private int version;
+    
+    public PathCondition() { 
+        // Empty
+    }
+    
+    public PathCondition(PathCondition aCondition) { 
+        primaryKey = aCondition.primaryKey;
+        version = aCondition.version;
+    }
+    
     /**
      * Checks if the path matches the condition.
      * 
@@ -31,5 +62,5 @@ public interface PathCondition extends Persistent {
      * 
      * @return True iff the path matches.
      */
-    boolean matches(String aPath);
+    public abstract boolean matches(String aPath);
 }