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.Cacheable;
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.EnumType;
25  import javax.persistence.Enumerated;
26  import javax.persistence.Lob;
27  import javax.persistence.Table;
28  import org.apache.syncope.common.lib.types.ImplementationEngine;
29  import org.apache.syncope.core.persistence.api.entity.Implementation;
30  import org.apache.syncope.core.persistence.jpa.validation.entity.ImplementationCheck;
31  
32  @Entity
33  @Table(name = JPAImplementation.TABLE)
34  @ImplementationCheck
35  @Cacheable
36  public class JPAImplementation extends AbstractProvidedKeyEntity implements Implementation {
37  
38      public static final String TABLE = "Implementation";
39  
40      private static final long serialVersionUID = 8700713975100295322L;
41  
42      @Column(nullable = false)
43      @Enumerated(EnumType.STRING)
44      private ImplementationEngine engine;
45  
46      @Column(nullable = false)
47      private String type;
48  
49      @Lob
50      private String body;
51  
52      @Override
53      public ImplementationEngine getEngine() {
54          return engine;
55      }
56  
57      @Override
58      public void setEngine(final ImplementationEngine engine) {
59          this.engine = engine;
60      }
61  
62      @Override
63      public String getType() {
64          return type;
65      }
66  
67      @Override
68      public void setType(final String type) {
69          this.type = type;
70      }
71  
72      @Override
73      public String getBody() {
74          return body;
75      }
76  
77      @Override
78      public void setBody(final String body) {
79          this.body = body;
80      }
81  }