diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java b/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
index 0c79d6d..29dd9d4 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
@@ -1,15 +1,22 @@
 package de.ids_mannheim.korap.constant;
 
 public enum PredefinedRole {
-    GROUP_ADMIN(1), GROUP_MEMBER(2), VC_ADMIN(3), VC_MEMBER(3);
+    GROUP_ADMIN(1), GROUP_MEMBER(2), VC_ADMIN(3), VC_MEMBER(4);
     
     private int id;
+    private String name;
 
     PredefinedRole (int i) {
         this.id = i;
+        this.name = name().toLowerCase().replace("_", " "); 
     }
     
     public int getId () {
         return id;
     }
+    
+    @Override
+    public String toString () {
+        return this.name;
+    }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
index ac73e26..fdf1c46 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
@@ -1,12 +1,15 @@
 package de.ids_mannheim.korap.dao;
 
 import java.util.List;
+import java.util.Set;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 import javax.persistence.Query;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.ListJoin;
+import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +20,8 @@
 import de.ids_mannheim.korap.entity.Privilege;
 import de.ids_mannheim.korap.entity.Role;
 import de.ids_mannheim.korap.entity.Role_;
+import de.ids_mannheim.korap.entity.UserGroupMember;
+import de.ids_mannheim.korap.entity.UserGroupMember_;
 
 @Transactional
 @Repository
@@ -40,12 +45,12 @@
         entityManager.remove(r);
     }
 
-    public void updateRoleName (int roleId, String name) {
+    public void editRoleName (int roleId, String name) {
         Role r = retrieveRoleById(roleId);
         r.setName(name);
         entityManager.persist(r);
     }
-    
+
     public Role retrieveRoleById (int roleId) {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<Role> query = criteriaBuilder.createQuery(Role.class);
@@ -70,4 +75,19 @@
         return (Role) q.getSingleResult();
     }
 
+    public List<Role> retrieveRoleByGroupMemberId (int userId) {
+        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Role> query = criteriaBuilder.createQuery(Role.class);
+
+        Root<Role> root = query.from(Role.class);
+        ListJoin<Role, UserGroupMember> memberRole =
+                root.join(Role_.userGroupMembers);
+
+        query.select(root);
+        query.where(criteriaBuilder.equal(memberRole.get(UserGroupMember_.id),
+                userId));
+        Query q = entityManager.createQuery(query);
+        return q.getResultList();
+    }
+
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
index f96cbd5..915a1ce 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
@@ -1,14 +1,17 @@
 package de.ids_mannheim.korap.dao;
 
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
 import javax.persistence.PersistenceContext;
 import javax.persistence.Query;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Join;
 import javax.persistence.criteria.ListJoin;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
@@ -27,7 +30,12 @@
 import de.ids_mannheim.korap.entity.UserGroupMember_;
 import de.ids_mannheim.korap.entity.UserGroup_;
 import de.ids_mannheim.korap.entity.VirtualCorpus;
-import de.ids_mannheim.korap.entity.VirtualCorpusAccessGroup;
+import de.ids_mannheim.korap.entity.VirtualCorpusAccess;
+import de.ids_mannheim.korap.entity.VirtualCorpusAccess_;
+import de.ids_mannheim.korap.entity.VirtualCorpus_;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.utils.ParameterChecker;
 
 @Transactional
 @Repository
@@ -41,28 +49,38 @@
     @Autowired
     private RoleDao roleDao;
 
-    public void createGroup (String name, String createdBy,
-            UserGroupStatus status) {
+    public int createGroup (String name, String createdBy,
+            UserGroupStatus status) throws KustvaktException {
+        ParameterChecker.checkStringValue(name, "name");
+        ParameterChecker.checkStringValue(createdBy, "createdBy");
+        ParameterChecker.checkObjectValue(status, "UserGroupStatus");
+
         UserGroup group = new UserGroup();
         group.setName(name);
         group.setStatus(status);
         group.setCreatedBy(createdBy);
         entityManager.persist(group);
 
-        Set<Role> roles = new HashSet<Role>(2);
+        List<Role> roles = new ArrayList<Role>(2);
         roles.add(roleDao.retrieveRoleById(PredefinedRole.GROUP_ADMIN.getId()));
         roles.add(roleDao.retrieveRoleById(PredefinedRole.VC_ADMIN.getId()));
 
         UserGroupMember owner = new UserGroupMember();
+        owner.setUserId(createdBy);
         owner.setCreatedBy(createdBy);
         owner.setStatus(GroupMemberStatus.ACTIVE);
         owner.setGroup(group);
         owner.setRoles(roles);
         entityManager.persist(owner);
+
+        return group.getId();
     }
 
     public void deleteGroup (int groupId, String deletedBy,
-            boolean isSoftDelete) {
+            boolean isSoftDelete) throws KustvaktException {
+        ParameterChecker.checkIntegerValue(groupId, "groupId");
+        ParameterChecker.checkStringValue(deletedBy, "deletedBy");
+
         UserGroup group = retrieveGroupById(groupId);
         if (isSoftDelete) {
             group.setStatus(UserGroupStatus.DELETED);
@@ -74,7 +92,25 @@
         }
     }
 
-    public UserGroup retrieveGroupById (int groupId) {
+    public void editGroupName (int groupId, String name)
+            throws KustvaktException {
+        UserGroup group = retrieveGroupById(groupId);
+        group.setName(name);
+        entityManager.persist(group);
+    }
+
+    /** Retrieves the UserGroup by the given group id. This methods does not 
+     *  fetch group members because only group admin is allowed to see them. 
+     *  Group members have to be retrieved separately.
+     * 
+     * @see UserGroupMember
+     * @param groupId group id
+     * @return UserGroup
+     * @throws KustvaktException 
+     */
+    public UserGroup retrieveGroupById (int groupId) throws KustvaktException {
+        ParameterChecker.checkIntegerValue(groupId, "groupId");
+
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<UserGroup> query =
                 criteriaBuilder.createQuery(UserGroup.class);
@@ -83,26 +119,69 @@
         query.select(root);
         query.where(criteriaBuilder.equal(root.get(UserGroup_.id), groupId));
         Query q = entityManager.createQuery(query);
-        return (UserGroup) q.getSingleResult();
+
+        UserGroup userGroup;
+        try {
+            userGroup = (UserGroup) q.getSingleResult();
+        }
+        catch (NoResultException e) {
+            throw new KustvaktException(StatusCodes.NO_RESULT_FOUND,
+                    "No result found for query: retrieve group by id "
+                            + groupId,
+                    String.valueOf(groupId), e);
+        }
+        return userGroup;
     }
 
-    public List<UserGroup> retrieveGroupByUserId (String userId) {
+    public UserGroup retrieveGroupWithMemberById (int groupId)
+            throws KustvaktException {
+
+        ParameterChecker.checkIntegerValue(groupId, "groupId");
+
+        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<UserGroup> query =
+                criteriaBuilder.createQuery(UserGroup.class);
+
+        Root<UserGroup> root = query.from(UserGroup.class);
+        root.fetch(UserGroup_.members);
+        query.select(root);
+        query.where(criteriaBuilder.equal(root.get(UserGroup_.id), groupId));
+        Query q = entityManager.createQuery(query);
+
+        UserGroup userGroup;
+        try {
+            userGroup = (UserGroup) q.getSingleResult();
+        }
+        catch (NoResultException e) {
+            throw new KustvaktException(StatusCodes.NO_RESULT_FOUND,
+                    "No result found for query: retrieve group by id "
+                            + groupId,
+                    String.valueOf(groupId), e);
+        }
+        return userGroup;
+    }
+
+    /** Retrieves only user-groups that are active (not hidden or deleted).
+     * 
+     * @param userId user id
+     * @return a list of UserGroup
+     * @throws KustvaktException
+     */
+    public List<UserGroup> retrieveGroupByUserId (String userId)
+            throws KustvaktException {
+        ParameterChecker.checkStringValue(userId, "userId");
+
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<UserGroup> query =
                 criteriaBuilder.createQuery(UserGroup.class);
 
         Root<UserGroup> root = query.from(UserGroup.class);
 
-        Predicate allUserGroup = criteriaBuilder.and(
-                criteriaBuilder.equal(root.get(UserGroup_.name),
-                        USER_GROUP_ALL),
-                criteriaBuilder.notEqual(root.get(UserGroup_.status),
-                        UserGroupStatus.DELETED));
-
-
         ListJoin<UserGroup, UserGroupMember> members =
                 root.join(UserGroup_.members);
-        Predicate memberships = criteriaBuilder.and(
+        Predicate restrictions = criteriaBuilder.and(
+                criteriaBuilder.equal(root.get(UserGroup_.status),
+                        UserGroupStatus.ACTIVE),
                 criteriaBuilder.equal(members.get(UserGroupMember_.userId),
                         userId),
                 criteriaBuilder.equal(members.get(UserGroupMember_.status),
@@ -110,14 +189,14 @@
 
 
         query.select(root);
-        query.where(criteriaBuilder.and(allUserGroup, memberships));
+        query.where(restrictions);
         Query q = entityManager.createQuery(query);
         return q.getResultList();
     }
 
     public void addVCToGroup (VirtualCorpus virtualCorpus, String createdBy,
             VirtualCorpusAccessStatus status, UserGroup group) {
-        VirtualCorpusAccessGroup accessGroup = new VirtualCorpusAccessGroup();
+        VirtualCorpusAccess accessGroup = new VirtualCorpusAccess();
         accessGroup.setCreatedBy(createdBy);
         accessGroup.setStatus(status);
         accessGroup.setUserGroup(group);
@@ -134,4 +213,26 @@
         }
     }
 
+    public void deleteVCFromGroup (int virtualCorpusId, int groupId) throws KustvaktException {
+        ParameterChecker.checkIntegerValue(virtualCorpusId, "virtualCorpusId");
+        ParameterChecker.checkIntegerValue(groupId, "groupId");
+
+        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<VirtualCorpusAccess> query =
+                criteriaBuilder.createQuery(VirtualCorpusAccess.class);
+
+        Root<VirtualCorpusAccess> root = query.from(VirtualCorpusAccess.class);
+        Join<VirtualCorpusAccess, VirtualCorpus> vc = root.join(VirtualCorpusAccess_.virtualCorpus);
+        Join<VirtualCorpusAccess, UserGroup> group = root.join(VirtualCorpusAccess_.userGroup);
+
+        Predicate virtualCorpus = criteriaBuilder.equal(vc.get(VirtualCorpus_.id), virtualCorpusId);
+        Predicate userGroup = criteriaBuilder.equal(group.get(UserGroup_.id), groupId);
+        
+        query.select(root);
+        query.where(criteriaBuilder.and(virtualCorpus, userGroup));
+        Query q = entityManager.createQuery(query);
+        VirtualCorpusAccess vcAccess = (VirtualCorpusAccess) q.getSingleResult();
+        entityManager.remove(vcAccess);
+    }
+
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
index f0789ac..1a80b92 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
@@ -23,26 +23,25 @@
 
 @Transactional
 @Repository
-public class UserGroupMemberDao<X> {
+public class UserGroupMemberDao {
 
     @PersistenceContext
     private EntityManager entityManager;
 
-    public void addMember (UserGroupMember member)
-            throws KustvaktException {
+    public void addMember (UserGroupMember member) throws KustvaktException {
         ParameterChecker.checkObjectValue(member, "userGroupMember");
         entityManager.persist(member);
     }
-    
+
     public void addMembers (List<UserGroupMember> members)
             throws KustvaktException {
         ParameterChecker.checkObjectValue(members, "List<UserGroupMember>");
 
-        for (UserGroupMember member: members){
+        for (UserGroupMember member : members) {
             addMember(member);
         }
     }
-    
+
     public void approveMember (String userId, int groupId)
             throws KustvaktException {
         ParameterChecker.checkStringValue(userId, "userId");
@@ -80,8 +79,10 @@
         Root<UserGroupMember> root = query.from(UserGroupMember.class);
 
         Predicate predicate = criteriaBuilder.and(
-                criteriaBuilder.equal(root.get(UserGroupMember_.group), groupId),
-                criteriaBuilder.equal(root.get(UserGroupMember_.userId), userId));
+                criteriaBuilder.equal(root.get(UserGroupMember_.group),
+                        groupId),
+                criteriaBuilder.equal(root.get(UserGroupMember_.userId),
+                        userId));
 
         query.select(root);
         query.where(predicate);
@@ -89,16 +90,18 @@
         return (UserGroupMember) q.getSingleResult();
     }
 
-    public List<UserGroupMember> retrieveMemberByRole (int groupId, int roleId) {
+    public List<UserGroupMember> retrieveMemberByRole (int groupId,
+            int roleId) {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<UserGroupMember> query =
                 criteriaBuilder.createQuery(UserGroupMember.class);
 
         Root<UserGroupMember> root = query.from(UserGroupMember.class);
         Join<UserGroupMember, Role> memberRole = root.join("roles");
-        
+
         Predicate predicate = criteriaBuilder.and(
-                criteriaBuilder.equal(root.get(UserGroupMember_.group), groupId),
+                criteriaBuilder.equal(root.get(UserGroupMember_.group),
+                        groupId),
                 criteriaBuilder.equal(memberRole.get("role_id"), roleId));
 
         query.select(root);
@@ -106,4 +109,20 @@
         Query q = entityManager.createQuery(query);
         return q.getResultList();
     }
+
+    public List<UserGroupMember> retrieveMemberByGroupId (int groupId) {
+        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<UserGroupMember> query =
+                criteriaBuilder.createQuery(UserGroupMember.class);
+
+        Root<UserGroupMember> root = query.from(UserGroupMember.class);
+
+        Predicate predicate = criteriaBuilder.and(criteriaBuilder
+                .equal(root.get(UserGroupMember_.group), groupId));
+
+        query.select(root);
+        query.where(predicate);
+        Query q = entityManager.createQuery(query);
+        return q.getResultList();
+    }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
index 266a788..a57ae75 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
@@ -11,6 +11,7 @@
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Join;
+import javax.persistence.criteria.ListJoin;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
@@ -22,10 +23,17 @@
 import de.ids_mannheim.korap.constant.VirtualCorpusAccessStatus;
 import de.ids_mannheim.korap.constant.VirtualCorpusType;
 import de.ids_mannheim.korap.entity.UserGroup;
+import de.ids_mannheim.korap.entity.UserGroupMember;
+import de.ids_mannheim.korap.entity.UserGroupMember_;
+import de.ids_mannheim.korap.entity.UserGroup_;
 import de.ids_mannheim.korap.entity.VirtualCorpus;
-import de.ids_mannheim.korap.entity.VirtualCorpusAccessGroup;
+import de.ids_mannheim.korap.entity.VirtualCorpusAccess;
+import de.ids_mannheim.korap.entity.VirtualCorpusAccess_;
+import de.ids_mannheim.korap.entity.VirtualCorpus_;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.user.User.CorpusAccess;
+import de.ids_mannheim.korap.utils.ParameterChecker;
 
 /** VirtualCorpusDao manages SQL queries regarding virtual corpora, 
  *  e.g. retrieving and storing virtual corpora.
@@ -40,8 +48,22 @@
     @PersistenceContext
     private EntityManager entityManager;
 
-    public void storeVirtualCorpus (VirtualCorpus virtualCorpus) {
-        entityManager.persist(virtualCorpus);
+    public int createVirtualCorpus (String name, VirtualCorpusType type,
+            CorpusAccess requiredAccess, String collectionQuery, String definition,
+            String description, String status, String createdBy) {
+
+        VirtualCorpus vc = new VirtualCorpus();
+        vc.setName(name);
+        vc.setType(type);
+        vc.setRequiredAccess(requiredAccess);
+        vc.setCollectionQuery(collectionQuery);
+        vc.setDefinition(definition);
+        vc.setDescription(description);
+        vc.setStatus(status);
+        vc.setCreatedBy(createdBy);
+        
+        entityManager.persist(vc);
+        return vc.getId();
     }
 
     public void deleteVirtualCorpus (int id) throws KustvaktException {
@@ -51,32 +73,30 @@
 
     public List<VirtualCorpus> retrieveVCByType (VirtualCorpusType type)
             throws KustvaktException {
-        if (type == null) {
-            throw new KustvaktException(StatusCodes.MISSING_ARGUMENT, "type",
-                    "null");
-        }
+        ParameterChecker.checkObjectValue(type, "type");
+
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<VirtualCorpus> query =
                 criteriaBuilder.createQuery(VirtualCorpus.class);
         Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
         query.select(virtualCorpus);
-        query.where(criteriaBuilder.equal(virtualCorpus.get("type"), type));
+        query.where(criteriaBuilder
+                .equal(virtualCorpus.get(VirtualCorpus_.type), type));
         Query q = entityManager.createQuery(query);
         return q.getResultList();
     }
 
 
     public VirtualCorpus retrieveVCById (int id) throws KustvaktException {
-        if (id == 0) {
-            throw new KustvaktException(StatusCodes.MISSING_ARGUMENT, "id",
-                    String.valueOf(id));
-        }
+        ParameterChecker.checkIntegerValue(id, "id");
+
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<VirtualCorpus> query =
                 criteriaBuilder.createQuery(VirtualCorpus.class);
         Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
         query.select(virtualCorpus);
-        query.where(criteriaBuilder.equal(virtualCorpus.get("id"), id));
+        query.where(criteriaBuilder.equal(virtualCorpus.get(VirtualCorpus_.id),
+                id));
 
         VirtualCorpus vc = null;
         try {
@@ -95,17 +115,16 @@
 
     public List<VirtualCorpus> retrievePrivateVC (String userId)
             throws KustvaktException {
-        if (userId == null || userId.isEmpty()) {
-            throw new KustvaktException(StatusCodes.MISSING_ARGUMENT, "userId",
-                    userId);
-        }
+        ParameterChecker.checkStringValue(userId, "userId");
+
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
         CriteriaQuery<VirtualCorpus> query =
                 builder.createQuery(VirtualCorpus.class);
 
         Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
         query.select(virtualCorpus);
-        query.where(builder.equal(virtualCorpus.get("createdBy"), userId));
+        query.where(builder.equal(virtualCorpus.get(VirtualCorpus_.createdBy),
+                userId));
 
         Query q = entityManager.createQuery(query);
         return q.getResultList();
@@ -114,35 +133,33 @@
 
     public List<VirtualCorpus> retrieveGroupVCByUser (String userId)
             throws KustvaktException {
-        if (userId == null || userId.isEmpty()) {
-            throw new KustvaktException(StatusCodes.MISSING_ARGUMENT, "userId",
-                    userId);
-        }
+        ParameterChecker.checkStringValue(userId, "userId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
         CriteriaQuery<VirtualCorpus> query =
                 builder.createQuery(VirtualCorpus.class);
 
         Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
-        Join<VirtualCorpus, VirtualCorpusAccessGroup> accessGroup =
-                virtualCorpus.join("accessGroup");
+        Join<VirtualCorpus, VirtualCorpusAccess> access =
+                virtualCorpus.join(VirtualCorpus_.virtualCorpusAccess);
 
         Predicate corpusStatus = builder.and(
-                builder.notEqual(accessGroup.get("status"),
+                builder.notEqual(access.get(VirtualCorpusAccess_.status),
                         VirtualCorpusAccessStatus.HIDDEN),
-                builder.notEqual(accessGroup.get("status"),
+                builder.notEqual(access.get(VirtualCorpusAccess_.status),
                         VirtualCorpusAccessStatus.DELETED));
-        
+
         Predicate userGroupStatus =
-                builder.notEqual(accessGroup.get("userGroup").get("status"),
-                        UserGroupStatus.DELETED);
-        Join<VirtualCorpusAccessGroup, UserGroup> userGroupMembers =
-                accessGroup.join("userGroup").join("members");
-        
-        Predicate memberStatus = builder.equal(userGroupMembers.get("status"),
-                GroupMemberStatus.ACTIVE);
-        
-        Predicate user = builder.equal(userGroupMembers.get("userId"), userId);
+                builder.notEqual(access.get(VirtualCorpusAccess_.userGroup)
+                        .get(UserGroup_.status), UserGroupStatus.DELETED);
+        Join<UserGroup, UserGroupMember> members = access
+                .join(VirtualCorpusAccess_.userGroup).join(UserGroup_.members);
+
+        Predicate memberStatus = builder.equal(
+                members.get(UserGroupMember_.status), GroupMemberStatus.ACTIVE);
+
+        Predicate user =
+                builder.equal(members.get(UserGroupMember_.userId), userId);
 
         query.select(virtualCorpus);
         query.where(
@@ -155,18 +172,17 @@
 
     public Set<VirtualCorpus> retrieveVCByUser (String userId)
             throws KustvaktException {
-        if (userId == null || userId.isEmpty()) {
-            throw new KustvaktException(StatusCodes.MISSING_ARGUMENT, "userId",
-                    userId);
-        }
+        ParameterChecker.checkStringValue(userId, "userId");
+
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
         CriteriaQuery<VirtualCorpus> query =
                 builder.createQuery(VirtualCorpus.class);
 
         Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
         Predicate predicate = builder.or(
-                builder.equal(virtualCorpus.get("createdBy"), userId),
-                builder.equal(virtualCorpus.get("type"),
+                builder.equal(virtualCorpus.get(VirtualCorpus_.createdBy),
+                        userId),
+                builder.equal(virtualCorpus.get(VirtualCorpus_.type),
                         VirtualCorpusType.PREDEFINED));
 
 
@@ -183,10 +199,31 @@
         return vcSet;
     }
 
+    public List<VirtualCorpus> retrieveVCByGroup (int groupId)
+            throws KustvaktException {
+        ParameterChecker.checkIntegerValue(groupId, "groupId");
+
+        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<VirtualCorpus> query =
+                builder.createQuery(VirtualCorpus.class);
+
+        Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
+        ListJoin<VirtualCorpus, VirtualCorpusAccess> corpusAccess =
+                virtualCorpus.join(VirtualCorpus_.virtualCorpusAccess);
+        Join<VirtualCorpusAccess, UserGroup> accessGroup =
+                corpusAccess.join(VirtualCorpusAccess_.userGroup);
+
+        query.select(virtualCorpus);
+        query.where(builder.equal(accessGroup.get(UserGroup_.id), groupId));
+        Query q = entityManager.createQuery(query);
+        return q.getResultList();
+    }
 
     // EM: what is needed for admin?
     public List<VirtualCorpus> retrieveVirtualCorpusByAdmin () {
         return null;
 
     }
+
+
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/Role.java b/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
index 685bf92..2d2571e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
@@ -35,10 +35,10 @@
     @ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY)
     private List<UserGroupMember> userGroupMembers;
 
-    @OneToMany(mappedBy = "role", fetch = FetchType.LAZY)
+    @OneToMany(mappedBy = "role", fetch = FetchType.EAGER)
     private List<Privilege> privileges;
 
     public String toString () {
-        return "id=" + id + "name=" + name;
+        return "id=" + id + ", name=" + name;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
index 7dc49b8..1ff0425 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
@@ -13,9 +13,6 @@
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
 
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
-
 import de.ids_mannheim.korap.constant.UserGroupStatus;
 import lombok.Getter;
 import lombok.Setter;
@@ -48,12 +45,11 @@
     @Enumerated(EnumType.STRING)
     private UserGroupStatus status;
 
-    @Fetch(FetchMode.SELECT)
-    @OneToMany(mappedBy="group")//, fetch = FetchType.LAZY)
+    @OneToMany(mappedBy="group", fetch = FetchType.LAZY)
     List<UserGroupMember> members;
 
     @OneToMany(mappedBy = "userGroup", fetch = FetchType.LAZY)
-    private List<VirtualCorpusAccessGroup> virtualCorpusAccessGroup;
+    private List<VirtualCorpusAccess> virtualCorpusAccess;
 
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
index 696c5c7..a4e9598 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.entity;
 
-import java.util.Set;
+import java.util.List;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -19,15 +19,17 @@
 import javax.persistence.UniqueConstraint;
 
 import de.ids_mannheim.korap.constant.GroupMemberStatus;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.constant.PredefinedRole;
 import lombok.Getter;
 import lombok.Setter;
 
-/** Describes members of user groups.
+/** Describes members of user groups. Only member of predefined role 
+ *  group admin can see the rest of members.
  * 
  *  @author margaretha
  *  @see UserGroup
  *  @see Role
+ *  @see PredefinedRole
  */
 @Setter
 @Getter
@@ -45,7 +47,7 @@
     private String createdBy;
     @Column(name = "deleted_by")
     private String deletedBy;
-    
+
     @Enumerated(EnumType.STRING)
     private GroupMemberStatus status;
 
@@ -53,7 +55,10 @@
     @JoinColumn(name = "group_id")
     private UserGroup group;
 
-    @ManyToMany(fetch = FetchType.LAZY)
+    /** Information about roles is deemed always necessary to describe a member.
+     * 
+     */
+    @ManyToMany(fetch = FetchType.EAGER)
     @JoinTable(name = "group_member_role",
             joinColumns = @JoinColumn(name = "group_member_id",
                     referencedColumnName = "id"),
@@ -61,23 +66,8 @@
                     referencedColumnName = "id"),
             uniqueConstraints = @UniqueConstraint(
                     columnNames = { "group_member_id", "role_id" }))
-    private Set<Role> roles;
+    private List<Role> roles;
 
-
-    public UserGroupMember createMember (String userId, String createdBy,
-            UserGroup userGroup, Set<Role> roles) throws KustvaktException {
-//        checkStringValue(userId, "userId");
-//        checkStringValue(createdBy, "createdBy");
-        
-        UserGroupMember member = new UserGroupMember();
-        member.setUserId(userId);
-        member.setCreatedBy(createdBy);
-        member.setGroup(userGroup);
-        member.setStatus(GroupMemberStatus.PENDING);
-        member.setRoles(roles);
-        return member;
-    }
-    
     @Override
     public String toString () {
         return "id=" + id + ", group= " + group + ", userId= " + userId
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
index deccdb8..8413c24 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
@@ -14,6 +14,7 @@
 import javax.persistence.Table;
 
 import de.ids_mannheim.korap.constant.VirtualCorpusType;
+import de.ids_mannheim.korap.user.User.CorpusAccess;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -25,7 +26,7 @@
  *   
  * @author margaretha
  *
- * @see VirtualCorpusAccessGroup
+ * @see VirtualCorpusAccess
  * @see UserGroup
  */
 @Setter
@@ -42,8 +43,9 @@
     private VirtualCorpusType type;
     private String status;
     private String description;
+    @Enumerated(EnumType.STRING)
     @Column(name = "required_access")
-    private String requiredAccess;
+    private CorpusAccess requiredAccess;
     @Column(name = "collection_query")
     private String collectionQuery;
     private String definition;
@@ -51,7 +53,7 @@
     private String createdBy;
 
     @OneToMany(mappedBy = "virtualCorpus", fetch=FetchType.LAZY)
-    private List<VirtualCorpusAccessGroup> accessGroup;
+    private List<VirtualCorpusAccess> virtualCorpusAccess;
 
     @Override
     public String toString () {
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpusAccess.java b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpusAccess.java
index 6fbedf6..873aac7 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpusAccess.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpusAccess.java
@@ -28,7 +28,7 @@
 @Getter
 @Entity
 @Table(name = "virtual_corpus_access")
-public class VirtualCorpusAccessGroup {
+public class VirtualCorpusAccess {
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
diff --git a/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql b/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
index 442a39c..db77480 100644
--- a/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
+++ b/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
@@ -2,16 +2,16 @@
 
 -- user groups
 INSERT INTO user_group(name,status,created_by) 
-	VALUES ("dory group","active","dory");
+	VALUES ("dory group","ACTIVE","dory");
 
 INSERT INTO user_group(name,status,created_by) 
-	VALUES ("auto group","hidden","system");
+	VALUES ("auto group","HIDDEN","system");
 
 INSERT INTO user_group(name,status,created_by) 
-	VALUES ("all users","hidden","system");
+	VALUES ("all users","HIDDEN","system");
 
 INSERT INTO user_group(name,status,created_by) 
-	VALUES ("deleted group","deleted","dory");
+	VALUES ("deleted group","DELETED","dory");
 
 
 
diff --git a/full/src/main/resources/db/insert/V3.3__insert_member_roles.sql b/full/src/main/resources/db/insert/V3.3__insert_member_roles.sql
new file mode 100644
index 0000000..459b5e2
--- /dev/null
+++ b/full/src/main/resources/db/insert/V3.3__insert_member_roles.sql
@@ -0,0 +1,28 @@
+-- member roles
+-- dory group
+INSERT INTO group_member_role(group_member_id,role_id)
+SELECT
+	(SELECT id FROM user_group_member WHERE user_id="dory" AND group_id=1),
+	(SELECT id FROM role WHERE name = "group admin");
+	
+INSERT INTO group_member_role(group_member_id,role_id)
+SELECT
+	(SELECT id FROM user_group_member WHERE user_id="dory" AND group_id=1),
+	(SELECT id FROM role WHERE name = "vc admin");
+	
+INSERT INTO group_member_role(group_member_id,role_id)
+SELECT
+	(SELECT id FROM user_group_member WHERE user_id="nemo" AND group_id=1),
+	(SELECT id FROM role WHERE name = "group member");
+	
+INSERT INTO group_member_role(group_member_id,role_id)
+SELECT
+	(SELECT id FROM user_group_member WHERE user_id="nemo" AND group_id=1),
+	(SELECT id FROM role WHERE name = "vc member");
+
+-- auto group
+INSERT INTO group_member_role(group_member_id,role_id)
+SELECT
+	(SELECT id FROM user_group_member WHERE user_id="pearl" AND group_id=2),
+	(SELECT id FROM role WHERE name = "vc member");
+
diff --git a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
index 27fb035..91b01a7 100644
--- a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
+++ b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
@@ -21,7 +21,8 @@
   id INTEGER PRIMARY KEY AUTOINCREMENT,
   name varchar(100) NOT NULL,
   status varchar(100) NOT NULL,
-  created_by varchar(100) NOT NULL
+  created_by varchar(100) NOT NULL,
+  deleted_by varchar(100) DEFAULT NULL
 );
 
 CREATE INDEX user_group_index ON user_group(status);
diff --git a/full/src/main/resources/db/predefined/V3.2__insert_predefined_roles.sql b/full/src/main/resources/db/predefined/V3.2__insert_predefined_roles.sql
index fdb8031..c9409ea 100644
--- a/full/src/main/resources/db/predefined/V3.2__insert_predefined_roles.sql
+++ b/full/src/main/resources/db/predefined/V3.2__insert_predefined_roles.sql
@@ -1,8 +1,8 @@
 -- roles
 INSERT INTO role(name) VALUES ("group admin");
 INSERT INTO role(name) VALUES ("group member");
-INSERT INTO role(name) VALUES ("VC admin");
-INSERT INTO role(name) VALUES ("VC member");
+INSERT INTO role(name) VALUES ("vc admin");
+INSERT INTO role(name) VALUES ("vc member");
 
 -- privileges
 INSERT INTO privilege(name,role_id)
diff --git a/full/src/main/resources/jdbc.properties b/full/src/main/resources/jdbc.properties
index 65fba6b..9b888f0 100644
--- a/full/src/main/resources/jdbc.properties
+++ b/full/src/main/resources/jdbc.properties
@@ -9,7 +9,7 @@
 #jdbc.password=password
 
 # db.insert contains test data, omit it in production setting
-#jdbc.schemaPath=db.new-mysql, db.insert
+#jdbc.schemaPath=db.new-mysql, db.insert, db.predefined
 
 
 #-------------------------------------------------------------------------------
@@ -22,4 +22,4 @@
 jdbc.username=pc
 jdbc.password=pc
 # db.insert contains test data, omit it in production setting
-jdbc.schemaPath=db.new-sqlite, db.insert
+jdbc.schemaPath=db.new-sqlite, db.insert, db.predefined
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
index c16b2c3..4c956ae 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
@@ -33,7 +33,7 @@
 
     @Test
     public void createDeleteRole () {
-        String roleName = "VC editor";
+        String roleName = "vc editor";
 
         List<PrivilegeType> privileges = new ArrayList<PrivilegeType>();
         privileges.add(PrivilegeType.READ);
@@ -50,12 +50,12 @@
     @Test
     public void updateRole () {
         Role role = roleDao.retrieveRoleByName("group member");
-        roleDao.updateRoleName(role.getId(), "group member role");
+        roleDao.editRoleName(role.getId(), "group member role");
 
         role = roleDao.retrieveRoleById(role.getId());
         assertEquals("group member role", role.getName());
 
-        roleDao.updateRoleName(role.getId(), "group member");
+        roleDao.editRoleName(role.getId(), "group member");
         role = roleDao.retrieveRoleById(role.getId());
         assertEquals("group member", role.getName());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
index 64521dd..e978e49 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
@@ -1,33 +1,147 @@
 package de.ids_mannheim.korap.dao;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.util.List;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
+import de.ids_mannheim.korap.constant.GroupMemberStatus;
+import de.ids_mannheim.korap.constant.PredefinedRole;
+import de.ids_mannheim.korap.constant.UserGroupStatus;
+import de.ids_mannheim.korap.constant.VirtualCorpusAccessStatus;
+import de.ids_mannheim.korap.constant.VirtualCorpusType;
+import de.ids_mannheim.korap.entity.Role;
+import de.ids_mannheim.korap.entity.UserGroup;
 import de.ids_mannheim.korap.entity.UserGroupMember;
+import de.ids_mannheim.korap.entity.VirtualCorpus;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.user.User.CorpusAccess;
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration("classpath:test-config.xml")
 public class UserGroupDaoTest {
 
     @Autowired
-    private UserGroupDao dao; 
-    
+    private UserGroupDao userGroupDao;
     @Autowired
-    protected ApplicationContext context;
+    private VirtualCorpusDao virtualCorpusDao;
+    @Autowired
+    private RoleDao roleDao;
 
     @Rule
     public ExpectedException thrown = ExpectedException.none();
-    
+
+
     @Test
-    public void testNewGroup () {
+    public void createDeleteNewUserGroup () throws KustvaktException {
+        String groupName = "test group";
+        String createdBy = "test class";
+        // create group
+        int groupId = userGroupDao.createGroup(groupName, createdBy,
+                UserGroupStatus.ACTIVE);
 
-        
+        // retrieve group
+        UserGroup group = userGroupDao.retrieveGroupWithMemberById(groupId);
+        assertEquals(groupName, group.getName());
+        assertEquals(createdBy, group.getCreatedBy());
+        assertEquals(UserGroupStatus.ACTIVE, group.getStatus());
+        assertNull(group.getDeletedBy());
 
+        // group member
+        List<UserGroupMember> members = group.getMembers();
+        assertEquals(1, members.size());
+        UserGroupMember m = members.get(0);
+        assertEquals(GroupMemberStatus.ACTIVE, m.getStatus());
+        assertEquals(createdBy, m.getCreatedBy());
+        assertEquals(createdBy, m.getUserId());
+
+        // member roles
+        List<Role> roles = roleDao.retrieveRoleByGroupMemberId(m.getId());
+        assertEquals(2, roles.size());
+        assertEquals(PredefinedRole.GROUP_ADMIN.getId(), roles.get(0).getId());
+        assertEquals(PredefinedRole.VC_ADMIN.getId(), roles.get(1).getId());
+
+        //retrieve VC by group
+        List<VirtualCorpus> vc = virtualCorpusDao.retrieveVCByGroup(groupId);
+        assertEquals(0, vc.size());
+
+        // soft delete group
+        userGroupDao.deleteGroup(groupId, createdBy, true);
+        group = userGroupDao.retrieveGroupById(groupId);
+        assertEquals(UserGroupStatus.DELETED, group.getStatus());
+
+        // hard delete
+        userGroupDao.deleteGroup(groupId, createdBy, false);
+        thrown.expect(KustvaktException.class);
+        group = userGroupDao.retrieveGroupById(groupId);
+    }
+
+    @Test
+    public void retrieveGroupWithMembers () throws KustvaktException {
+        List<UserGroupMember> members =
+                userGroupDao.retrieveGroupWithMemberById(1).getMembers();
+        assertEquals(4, members.size());
+
+        UserGroupMember m = members.get(1);
+        List<Role> roles = m.getRoles();
+        assertEquals(2, roles.size());
+        assertEquals(PredefinedRole.GROUP_MEMBER.getId(), roles.get(0).getId());
+        assertEquals(PredefinedRole.VC_MEMBER.getId(), roles.get(1).getId());
+    }
+
+    @Test
+    public void retrieveGroupByUserId () throws KustvaktException {
+        List<UserGroup> group = userGroupDao.retrieveGroupByUserId("dory");
+        assertEquals(1, group.size());
+
+        group = userGroupDao.retrieveGroupByUserId("pearl");
+        assertEquals(0, group.size());
+    }
+
+    @Test
+    public void editExistingGroupName () throws KustvaktException {
+        UserGroup group = userGroupDao.retrieveGroupById(1);
+        String name = group.getName();
+        String newName = "new vc name";
+        userGroupDao.editGroupName(1, newName);
+        group = userGroupDao.retrieveGroupById(1);
+        assertEquals(newName, group.getName());
+
+        userGroupDao.editGroupName(1, name);
+        group = userGroupDao.retrieveGroupById(1);
+        assertEquals(name, group.getName());
+    }
+
+    @Test
+    public void addVCToGroup () throws KustvaktException {
+        // dory group
+        int groupId = 1;
+
+        UserGroup group = userGroupDao.retrieveGroupById(groupId);
+        String createdBy = "dory";
+        String name = "dory new vc";
+        int id = virtualCorpusDao.createVirtualCorpus(name, VirtualCorpusType.PROJECT,
+                CorpusAccess.PUB, "corpusSigle=WPD15", "", "", "", createdBy);
+
+        VirtualCorpus virtualCorpus = virtualCorpusDao.retrieveVCById(id);
+        userGroupDao.addVCToGroup(virtualCorpus, createdBy,
+                VirtualCorpusAccessStatus.ACTIVE, group);
+
+        List<VirtualCorpus> vc = virtualCorpusDao.retrieveVCByGroup(groupId);
+        assertEquals(2, vc.size());
+        assertEquals(name, vc.get(1).getName());
+
+        userGroupDao.deleteVCFromGroup(virtualCorpus.getId(), groupId);
+
+        vc = virtualCorpusDao.retrieveVCByGroup(groupId);
+        assertEquals(1, vc.size());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
index 9774865..d80c454 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
@@ -11,14 +11,13 @@
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import de.ids_mannheim.korap.constant.VirtualCorpusType;
-import de.ids_mannheim.korap.dao.VirtualCorpusDao;
 import de.ids_mannheim.korap.entity.VirtualCorpus;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.user.User;
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration("classpath:test-config.xml")
@@ -26,8 +25,6 @@
 
     @Autowired
     private VirtualCorpusDao dao;
-    @Autowired
-    protected ApplicationContext context;
 
     @Rule
     public ExpectedException thrown = ExpectedException.none();
@@ -36,13 +33,9 @@
     @Test
     public void testPredefinedVC () throws KustvaktException {
         // insert vc
-        VirtualCorpus vc = new VirtualCorpus();
-        vc.setName("predefined VC");
-        vc.setCreatedBy("test class");
-        vc.setCollectionQuery("corpusSigle=GOE");
-        vc.setRequiredAccess("free");
-        vc.setType(VirtualCorpusType.PREDEFINED);
-        dao.storeVirtualCorpus(vc);
+        int id = dao.createVirtualCorpus("predefined VC", VirtualCorpusType.PREDEFINED,
+                User.CorpusAccess.FREE, "corpusSigle=GOE", "definition",
+                "description", "experimental", "test class");
 
         // select vc
         List<VirtualCorpus> vcList =
@@ -50,11 +43,11 @@
         assertEquals(2, vcList.size());
 
         // delete vc
-        dao.deleteVirtualCorpus(vc.getId());
+        dao.deleteVirtualCorpus(id);
 
         // check if vc has been deleted
         thrown.expect(KustvaktException.class);
-        vc = dao.retrieveVCById(vc.getId());
+        dao.retrieveVCById(id);
     }
 
 
diff --git a/full/src/test/resources/test-jdbc.properties b/full/src/test/resources/test-jdbc.properties
index c106656..db40081 100644
--- a/full/src/test/resources/test-jdbc.properties
+++ b/full/src/test/resources/test-jdbc.properties
@@ -8,4 +8,4 @@
 jdbc.username=pc
 jdbc.password=pc
 #jdbc.schemaPath=classpath:db.sqlite
-jdbc.schemaPath=classpath:db.new-sqlite, db.insert
\ No newline at end of file
+jdbc.schemaPath=classpath:db.new-sqlite, db.insert, db.predefined
\ No newline at end of file
