View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.persistence.jpa.entity;
20  
21  import javax.persistence.Entity;
22  import javax.persistence.ManyToOne;
23  import javax.persistence.OneToOne;
24  import javax.persistence.Table;
25  import javax.validation.constraints.NotNull;
26  import org.apache.syncope.core.persistence.api.entity.AnyType;
27  import org.apache.syncope.core.persistence.api.entity.DynRealm;
28  import org.apache.syncope.core.persistence.api.entity.DynRealmMembership;
29  
30  @Entity
31  @Table(name = JPADynRealmMembership.TABLE)
32  public class JPADynRealmMembership extends AbstractGeneratedKeyEntity implements DynRealmMembership {
33  
34      private static final long serialVersionUID = 8157856850557493134L;
35  
36      public static final String TABLE = "DynRealmMembership";
37  
38      @OneToOne
39      private JPADynRealm dynRealm;
40  
41      @ManyToOne
42      private JPAAnyType anyType;
43  
44      @NotNull
45      private String fiql;
46  
47      @Override
48      public DynRealm getDynRealm() {
49          return dynRealm;
50      }
51  
52      @Override
53      public void setDynRealm(final DynRealm dynRealm) {
54          checkType(dynRealm, JPADynRealm.class);
55          this.dynRealm = (JPADynRealm) dynRealm;
56      }
57  
58      @Override
59      public AnyType getAnyType() {
60          return anyType;
61      }
62  
63      @Override
64      public void setAnyType(final AnyType anyType) {
65          checkType(anyType, JPAAnyType.class);
66          this.anyType = (JPAAnyType) anyType;
67      }
68  
69      @Override
70      public String getFIQLCond() {
71          return fiql;
72      }
73  
74      @Override
75      public void setFIQLCond(final String fiql) {
76          this.fiql = fiql;
77      }
78  
79  }