*/
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;
/**
*
* @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.
*
*
* @return True iff the path matches.
*/
- boolean matches(String aPath);
+ public abstract boolean matches(String aPath);
}