From 70e733f392ed7647c6ca08f79bc2d3da323a56bb Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Fri, 12 Jul 2013 17:33:10 +0200
Subject: [PATCH] OO-662: clean up the last trace of o_re_strict views

---
 .../model/RepositoryEntryStrictMember.java    | 90 -------------------
 .../database/mysql/alter_8_4_0_to_9_0_0.sql   |  4 +-
 .../database/mysql/setupDatabase.sql          | 47 ----------
 .../database/oracle/alter_8_4_0_to_9_0_0.sql  |  4 +-
 .../database/oracle/setupDatabase.sql         | 47 ----------
 .../postgresql/alter_8_4_0_to_9_0_0.sql       |  4 +-
 .../database/postgresql/setupDatabase.sql     | 47 ----------
 7 files changed, 9 insertions(+), 234 deletions(-)
 delete mode 100644 src/main/java/org/olat/repository/model/RepositoryEntryStrictMember.java

diff --git a/src/main/java/org/olat/repository/model/RepositoryEntryStrictMember.java b/src/main/java/org/olat/repository/model/RepositoryEntryStrictMember.java
deleted file mode 100644
index 223cb4c20af..00000000000
--- a/src/main/java/org/olat/repository/model/RepositoryEntryStrictMember.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * <a href="http://www.openolat.org">
- * OpenOLAT - Online Learning and Training</a><br>
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); <br>
- * you may not use this file except in compliance with the License.<br>
- * You may obtain a copy of the License at the
- * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
- * <p>
- * Unless required by applicable law or agreed to in writing,<br>
- * software distributed under the License is distributed on an "AS IS" BASIS, <br>
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
- * See the License for the specific language governing permissions and <br>
- * limitations under the License.
- * <p>
- * Initial code contributed and copyrighted by<br>
- * frentix GmbH, http://www.frentix.com
- * <p>
- */
-package org.olat.repository.model;
-
-import org.olat.core.commons.persistence.PersistentObject;
-
-/**
- * 
- * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
- */
-public class RepositoryEntryStrictMember extends PersistentObject {
-
-	private static final long serialVersionUID = 3795108974268603941L;
-	
-	private Long repoParticipantKey;
-	private Long repoTutorKey;
-	private Long repoOwnerKey;
-	private Long groupParticipantKey;
-	private Long groupOwnerKey;
-
-	public Long getRepoParticipantKey() {
-		return repoParticipantKey;
-	}
-	
-	public void setRepoParticipantKey(Long repoParticipantKey) {
-		this.repoParticipantKey = repoParticipantKey;
-	}
-	
-	public Long getRepoTutorKey() {
-		return repoTutorKey;
-	}
-
-	public void setRepoTutorKey(Long repoTutorKey) {
-		this.repoTutorKey = repoTutorKey;
-	}
-
-	public Long getRepoOwnerKey() {
-		return repoOwnerKey;
-	}
-	
-	public void setRepoOwnerKey(Long repoOwnerKey) {
-		this.repoOwnerKey = repoOwnerKey;
-	}
-	
-	public Long getGroupParticipantKey() {
-		return groupParticipantKey;
-	}
-	
-	public void setGroupParticipantKey(Long groupParticipantKey) {
-		this.groupParticipantKey = groupParticipantKey;
-	}
-	
-	public Long getGroupOwnerKey() {
-		return groupOwnerKey;
-	}
-	
-	public void setGroupOwnerKey(Long groupOwnerKey) {
-		this.groupOwnerKey = groupOwnerKey;
-	}
-
-	@Override
-	public int hashCode() {
-		return getKey() == null ? 3768 : getKey().hashCode();
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		if(this == obj) {
-			return true;
-		}
-		return false;
-	}
-}
diff --git a/src/main/resources/database/mysql/alter_8_4_0_to_9_0_0.sql b/src/main/resources/database/mysql/alter_8_4_0_to_9_0_0.sql
index f92edadc627..5f61dc03cb8 100644
--- a/src/main/resources/database/mysql/alter_8_4_0_to_9_0_0.sql
+++ b/src/main/resources/database/mysql/alter_8_4_0_to_9_0_0.sql
@@ -457,7 +457,9 @@ create or replace view o_gp_business_v  as (
    from o_gp_business as gp
 );
 
-
+drop view o_re_strict_participant_v;
+drop view o_re_strict_tutor_v;
+drop view o_re_strict_member_v;
 
 
 
diff --git a/src/main/resources/database/mysql/setupDatabase.sql b/src/main/resources/database/mysql/setupDatabase.sql
index 5c16322da5e..3314fc22d02 100644
--- a/src/main/resources/database/mysql/setupDatabase.sql
+++ b/src/main/resources/database/mysql/setupDatabase.sql
@@ -1421,53 +1421,6 @@ create or replace view o_gp_business_v  as (
    from o_gp_business as gp
 );
 
-create or replace view o_re_strict_member_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_part_member.identity_id as bg_part_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_bs_membership as re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership as re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   left join o_bs_membership as bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where re.membersonly=1 and re.accesscode=1
-);
-
-create or replace view o_re_strict_participant_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      bg_part_member.identity_id as bg_part_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   where (re.membersonly=1 and re.accesscode=1) or re.accesscode>=3
-);
-
-create or replace view o_re_strict_tutor_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership as re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where (re.membersonly=1 and re.accesscode=1) or re.accesscode>=3
-);
-
 create or replace view o_re_membership_v as (
    select
       membership.id as membership_id,
diff --git a/src/main/resources/database/oracle/alter_8_4_0_to_9_0_0.sql b/src/main/resources/database/oracle/alter_8_4_0_to_9_0_0.sql
index 998a48e2137..957f67959ca 100644
--- a/src/main/resources/database/oracle/alter_8_4_0_to_9_0_0.sql
+++ b/src/main/resources/database/oracle/alter_8_4_0_to_9_0_0.sql
@@ -538,7 +538,9 @@ create or replace view o_gp_business_v  as (
    from o_gp_business gp
 );
 
-
+drop view o_re_strict_participant_v;
+drop view o_re_strict_tutor_v;
+drop view o_re_strict_member_v;
 
 
 
diff --git a/src/main/resources/database/oracle/setupDatabase.sql b/src/main/resources/database/oracle/setupDatabase.sql
index 5b493662bb4..4724dae8f50 100644
--- a/src/main/resources/database/oracle/setupDatabase.sql
+++ b/src/main/resources/database/oracle/setupDatabase.sql
@@ -1425,53 +1425,6 @@ create or replace view o_gp_business_to_repository_v as (
 	inner join o_repositoryentry repoentry on (repoentry.fk_olatresource = relation.fk_resource)
 );
 
-create or replace view o_re_strict_member_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_part_member.identity_id as bg_part_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry re
-   left join o_bs_membership re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_bs_membership re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   left join o_bs_membership bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where re.membersonly=1 and re.accesscode=1
-);
-
-create or replace view o_re_strict_participant_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      bg_part_member.identity_id as bg_part_member_id
-   from o_repositoryentry re
-   left join o_bs_membership re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_gp_business_to_resource bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   where (re.membersonly=1 and re.accesscode=1) or re.accesscode>=3
-);
-
-create or replace view o_re_strict_tutor_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry re
-   left join o_bs_membership re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where (re.membersonly=1 and re.accesscode=1) or re.accesscode>=3
-);
-
 create or replace view o_re_membership_v as (
    select
       membership.id as membership_id,
diff --git a/src/main/resources/database/postgresql/alter_8_4_0_to_9_0_0.sql b/src/main/resources/database/postgresql/alter_8_4_0_to_9_0_0.sql
index a059833c72c..ad635995a2b 100644
--- a/src/main/resources/database/postgresql/alter_8_4_0_to_9_0_0.sql
+++ b/src/main/resources/database/postgresql/alter_8_4_0_to_9_0_0.sql
@@ -595,7 +595,9 @@ create or replace view o_gp_business_v  as (
    from o_gp_business as gp
 );
 
-
+drop view o_re_strict_participant_v;
+drop view o_re_strict_tutor_v;
+drop view o_re_strict_member_v;
 
 
 
diff --git a/src/main/resources/database/postgresql/setupDatabase.sql b/src/main/resources/database/postgresql/setupDatabase.sql
index 1520f771b0b..ac7a3de0c69 100644
--- a/src/main/resources/database/postgresql/setupDatabase.sql
+++ b/src/main/resources/database/postgresql/setupDatabase.sql
@@ -1416,53 +1416,6 @@ create or replace view o_gp_business_v  as (
    from o_gp_business as gp
 );
 
-create or replace view o_re_strict_member_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_part_member.identity_id as bg_part_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_bs_membership as re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership as re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   left join o_bs_membership as bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where re.membersonly=true and re.accesscode=1
-);
-
-create or replace view o_re_strict_participant_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_part_member.identity_id as re_part_member_id,
-      bg_part_member.identity_id as bg_part_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_part_member on (re_part_member.secgroup_id = re.fk_participantgroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_part_member on (bg_part_member.secgroup_id = bgroup.fk_partipiciantgroup)
-   where (re.membersonly=true and re.accesscode=1) or re.accesscode>=3
-);
-
-create or replace view o_re_strict_tutor_v as (
-   select
-      re.repositoryentry_id as re_id,
-      re_tutor_member.identity_id as re_tutor_member_id,
-      re_owner_member.identity_id as re_owner_member_id,
-      bg_owner_member.identity_id as bg_owner_member_id
-   from o_repositoryentry as re
-   left join o_bs_membership as re_tutor_member on (re_tutor_member.secgroup_id = re.fk_tutorgroup)
-   left join o_bs_membership as re_owner_member on (re_owner_member.secgroup_id = re.fk_ownergroup)
-   left join o_gp_business_to_resource as bgroup_rel on (bgroup_rel.fk_resource = re.fk_olatresource)
-   left join o_gp_business as bgroup on (bgroup.group_id = bgroup_rel.fk_group)
-   left join o_bs_membership as bg_owner_member on (bg_owner_member.secgroup_id = bgroup.fk_ownergroup)
-   where (re.membersonly=true and re.accesscode=1) or re.accesscode>=3
-);
-
 create or replace view o_re_membership_v as (
    select
       membership.id as membership_id,
-- 
GitLab