Separating security into a part that depends only on the JPA and into a
[utils] / security / impl / src / main / resources / hbm / Group.hbm.xml
diff --git a/security/impl/src/main/resources/hbm/Group.hbm.xml b/security/impl/src/main/resources/hbm/Group.hbm.xml
new file mode 100644 (file)
index 0000000..41e5e6b
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+    
+<hibernate-mapping>
+    
+    <class name="org.wamblee.usermgt.Group" table="GROUPS" select-before-update="true">
+        <id name="primaryKey" column="ID" type="long">
+            <generator class="native"/>
+        </id>
+        <version name="persistedVersion" column="VERSION"/>
+        <property name="name" column="NAME" unique="true"/>
+    </class>
+    
+    <query name="findGroupByName">
+        from org.wamblee.usermgt.Group grp where grp.name = :name
+    </query>
+    
+    <query name="countGroups">
+        select count(*)
+        from org.wamblee.usermgt.Group group 
+    </query>
+    
+</hibernate-mapping>
\ No newline at end of file