Now working with both hibernate and eclipselink
[utils] / security / impl / src / main / java / org / wamblee / usermgt / jpa / JpaGroupSet.java
index b9db23975f748f71e3124eb7a45b5d4c8a18bd7b..a9d579e2b89a76561a319058cb9f168e780124bd 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2005-2010 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.wamblee.usermgt.jpa;
 
 import java.util.List;
@@ -11,6 +26,11 @@ import org.wamblee.persistence.JpaMergeSupport;
 import org.wamblee.usermgt.Group;
 import org.wamblee.usermgt.GroupSet;
 
+/**
+ * Group set backed by the database.
+ * 
+ * @author Erik Brakkee
+ */
 public class JpaGroupSet implements GroupSet {
 
     private EntityManager em;
@@ -26,6 +46,7 @@ public class JpaGroupSet implements GroupSet {
             return false;
         }
         em.persist(aGroup);
+        em.flush(); // to make sure the version is updated. 
         return true;
     }