You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/02/09 17:20:36 UTC
[2/3] syncope git commit: [SYNCOPE-620] MariaDB, SQL Server
[SYNCOPE-620] MariaDB, SQL Server
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/40892e19
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/40892e19
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/40892e19
Branch: refs/heads/2_0_X
Commit: 40892e192609d22eabd6dfaaf23a6f313d8d572c
Parents: 498eb7e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Feb 9 16:38:32 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Feb 9 16:38:32 2015 +0100
----------------------------------------------------------------------
.../server/logic/init/CamelRouteLoader.java | 26 +-
syncope620/fit/server-reference/pom.xml | 66 ++++
.../resources/mariadb/persistence.properties | 29 ++
.../main/resources/sqlserver/META-INF/orm.xml | 359 +++++++++++++++++++
.../resources/sqlserver/persistence.properties | 29 ++
.../server/persistence/jpa/dao/JPAUserDAO.java | 2 +-
.../main/resources/quartz/tables_mariadb.sql | 206 +++++++++++
7 files changed, 713 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/ext/camel/logic/src/main/java/org/apache/syncope/server/logic/init/CamelRouteLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/ext/camel/logic/src/main/java/org/apache/syncope/server/logic/init/CamelRouteLoader.java b/syncope620/ext/camel/logic/src/main/java/org/apache/syncope/server/logic/init/CamelRouteLoader.java
index a7f24a7..2dd3b52 100644
--- a/syncope620/ext/camel/logic/src/main/java/org/apache/syncope/server/logic/init/CamelRouteLoader.java
+++ b/syncope620/ext/camel/logic/src/main/java/org/apache/syncope/server/logic/init/CamelRouteLoader.java
@@ -140,8 +140,28 @@ public class CamelRouteLoader implements SyncopeLoader {
private void loadEntitlements() {
final JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_READ')");
- jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_LIST')");
- jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_UPDATE')");
+
+ boolean existingData;
+ try {
+ existingData = jdbcTemplate.queryForObject(
+ "SELECT COUNT(0) FROM Entitlement WHERE NAME LIKE 'ROUTE_%'", Integer.class) > 0;
+ } catch (DataAccessException e) {
+ LOG.error("Could not access to Entitlement table", e);
+ existingData = true;
+ }
+
+ if (existingData) {
+ LOG.info("Data found in the database, leaving untouched");
+ } else {
+ LOG.info("Empty database found, loading default content");
+
+ try {
+ jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_READ')");
+ jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_LIST')");
+ jdbcTemplate.update("INSERT INTO Entitlement(NAME) VALUES('ROUTE_UPDATE')");
+ } catch (Exception e) {
+ LOG.error("While adding additional entitlements", e);
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/fit/server-reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/pom.xml b/syncope620/fit/server-reference/pom.xml
index 034fe69..b10f292 100644
--- a/syncope620/fit/server-reference/pom.xml
+++ b/syncope620/fit/server-reference/pom.xml
@@ -416,6 +416,72 @@ under the License.
</profile>
<profile>
+ <id>mariadb-it</id>
+
+ <properties>
+ <jdbcdriver.groupId>org.mariadb.jdbc</jdbcdriver.groupId>
+ <jdbcdriver.artifactId>mariadb-java-client</jdbcdriver.artifactId>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>1.1.8</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>clean verify</defaultGoal>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>src/main/resources/mariadb</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+
+ <profile>
+ <id>sqlserver-it</id>
+
+ <properties>
+ <jdbcdriver.groupId>com.microsoft.sqlserver</jdbcdriver.groupId>
+ <jdbcdriver.artifactId>sqljdbc4</jdbcdriver.artifactId>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>sqljdbc4</artifactId>
+ <version>4.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>clean verify</defaultGoal>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>src/main/resources/sqlserver</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+
+ <profile>
<id>debug</id>
<properties>
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/fit/server-reference/src/main/resources/mariadb/persistence.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/mariadb/persistence.properties b/syncope620/fit/server-reference/src/main/resources/mariadb/persistence.properties
new file mode 100644
index 0000000..f566122
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/mariadb/persistence.properties
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+content.directory=${conf.directory}
+jpa.driverClassName=org.mariadb.jdbc.Driver
+jpa.url=jdbc:mariadb://localhost:3306/syncope?characterEncoding=UTF-8
+jpa.username=syncope
+jpa.password=syncope
+jpa.dialect=org.apache.openjpa.jdbc.sql.MariaDBDictionary
+jpa.pool.validationQuery=SELECT 1
+#note: other connection pool settings can also be configured here, see persistenceContext.xml
+quartz.jobstore=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+quartz.scheduler.idleWaitTime=5000
+quartz.sql=tables_mariadb.sql
+audit.sql=audit.sql
+database.schema=
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/fit/server-reference/src/main/resources/sqlserver/META-INF/orm.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/sqlserver/META-INF/orm.xml b/syncope620/fit/server-reference/src/main/resources/sqlserver/META-INF/orm.xml
new file mode 100644
index 0000000..c1e154a
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/sqlserver/META-INF/orm.xml
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
+ http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
+ version="2.0">
+
+ <persistence-unit-metadata>
+ <persistence-unit-defaults>
+ <entity-listeners>
+ <entity-listener class="org.apache.syncope.server.persistence.jpa.validation.entity.EntityValidationListener">
+ <pre-persist method-name="validate"/>
+ <pre-update method-name="validate"/>
+ </entity-listener>
+ </entity-listeners>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+
+ <table-generator name="SEQ_UPlainAttrValue" pk-column-value="SEQ_UPlainAttrValue" initial-value="100"/>
+ <table-generator name="SEQ_RPlainAttrValue" pk-column-value="SEQ_RPlainAttrValue" initial-value="100"/>
+ <table-generator name="SEQ_MAttrPlainValue" pk-column-value="SEQ_MAttrPlainValue" initial-value="100"/>
+ <table-generator name="SEQ_CAttrPlainValue" pk-column-value="SEQ_CAttrPlainValue" initial-value="100"/>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUser">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_User" strategy="TABLE"/>
+ <table-generator name="SEQ_User" pk-column-value="SEQ_User" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARole">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Role" strategy="TABLE"/>
+ <table-generator name="SEQ_Role" pk-column-value="SEQ_Role" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.membership.JPAMembership">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Membership" strategy="TABLE"/>
+ <table-generator name="SEQ_Membership" pk-column-value="SEQ_Membership" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUMapping">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_UMapping" strategy="TABLE"/>
+ <table-generator name="SEQ_UMapping" pk-column-value="SEQ_UMapping" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARMapping">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RMapping" strategy="TABLE"/>
+ <table-generator name="SEQ_RMapping" pk-column-value="SEQ_RMapping" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUMappingItem">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_UMappingItem" strategy="TABLE"/>
+ <table-generator name="SEQ_UMappingItem" pk-column-value="SEQ_UMappingItem" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARMappingItem">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RMappingItem" strategy="TABLE"/>
+ <table-generator name="SEQ_RMappingItem" pk-column-value="SEQ_RMappingItem" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPAConnInstance">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_ConnInstance" strategy="TABLE"/>
+ <table-generator name="SEQ_ConnInstance" pk-column-value="SEQ_ConnInstance" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUPlainAttr">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_UPlainAttr" strategy="TABLE"/>
+ <table-generator name="SEQ_UPlainAttr" pk-column-value="SEQ_UPlainAttr" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARPlainAttr">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RPlainAttr" strategy="TABLE"/>
+ <table-generator name="SEQ_RPlainAttr" pk-column-value="SEQ_RPlainAttr" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARPlainAttrTemplate">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RPlainAttrTemplate" strategy="TABLE"/>
+ <table-generator name="SEQ_RPlainAttrTemplate" pk-column-value="SEQ_RPlainAttrTemplate" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.membership.JPAMPlainAttr">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_MPlainAttr" strategy="TABLE"/>
+ <table-generator name="SEQ_MPlainAttr" pk-column-value="SEQ_MPlainAttr" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.membership.JPAMPlainAttrTemplate">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_MPlainAttrTemplate" strategy="TABLE"/>
+ <table-generator name="SEQ_MPlainAttrTemplate" pk-column-value="SEQ_MPlainAttrTemplate" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.conf.JPACPlainAttr">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_CAttrPlain" strategy="TABLE"/>
+ <table-generator name="SEQ_CAttrPlain" pk-column-value="SEQ_CAttrPlain" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUPlainAttrValue">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_UPlainAttrValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.user.JPAUPlainAttrUniqueValue">
+ <table>
+ <unique-constraint>
+ <column-name>booleanValue</column-name>
+ <column-name>dateValue</column-name>
+ <column-name>stringValue</column-name>
+ <column-name>doubleValue</column-name>
+ <column-name>longValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ </table>
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_UPlainAttrValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARPlainAttrValue">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RPlainAttrValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.role.JPARPlainAttrUniqueValue">
+ <table>
+ <unique-constraint>
+ <column-name>booleanValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>dateValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>stringValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>doubleValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>longValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ </table>
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_RPlainAttrValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.membership.JPAMPlainAttrValue">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_MAttrPlainValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.membership.JPAMPlainAttrUniqueValue">
+ <table>
+ <unique-constraint>
+ <column-name>booleanValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>dateValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>stringValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>doubleValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>longValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ </table>
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_MAttrPlainValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.conf.JPACPlainAttrValue">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_CAttrPlainValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.conf.JPACPlainAttrUniqueValue">
+ <table>
+ <unique-constraint>
+ <column-name>booleanValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>dateValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>stringValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>doubleValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ <unique-constraint>
+ <column-name>longValue</column-name>
+ <column-name>schema_name</column-name>
+ </unique-constraint>
+ </table>
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_CAttrPlainValue" strategy="TABLE"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.task.JPATask">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Task" strategy="TABLE"/>
+ <table-generator name="SEQ_Task" pk-column-value="SEQ_Task" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.task.JPATaskExec">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_TaskExec" strategy="TABLE"/>
+ <table-generator name="SEQ_TaskExec" pk-column-value="SEQ_TaskExec" initial-value="10"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPAPolicy">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Policy" strategy="TABLE"/>
+ <table-generator name="SEQ_Policy" pk-column-value="SEQ_Policy" initial-value="1000"/>
+ </id>
+ </attributes>
+ </entity>
+
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPAReport">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Report" strategy="TABLE"/>
+ <table-generator name="SEQ_Report" pk-column-value="SEQ_Report" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPAReportExec">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_ReportExec" strategy="TABLE"/>
+ <table-generator name="SEQ_ReportExec" pk-column-value="SEQ_ReportExec" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPAReportletConfInstance">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_ReportletConfInstance" strategy="TABLE"/>
+ <table-generator name="SEQ_ReportletConfInstance" pk-column-value="SEQ_ReportletConfInstance" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPANotification">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_Notification" strategy="TABLE"/>
+ <table-generator name="SEQ_Notification" pk-column-value="SEQ_Notification" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+ <entity class="org.apache.syncope.server.persistence.jpa.entity.JPASecurityQuestion">
+ <attributes>
+ <id name="id">
+ <generated-value generator="SEQ_SecurityQuestion" strategy="TABLE"/>
+ <table-generator name="SEQ_SecurityQuestion" pk-column-value="SEQ_SecurityQuestion" initial-value="100"/>
+ </id>
+ </attributes>
+ </entity>
+</entity-mappings>
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/fit/server-reference/src/main/resources/sqlserver/persistence.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/sqlserver/persistence.properties b/syncope620/fit/server-reference/src/main/resources/sqlserver/persistence.properties
new file mode 100644
index 0000000..cfdf5b0
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/sqlserver/persistence.properties
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+content.directory=${conf.directory}
+jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+jpa.url=jdbc:sqlserver://acacia:1433;database=syncope;selectMethod=cursor;sendStringParametersAsUnicode=false
+jpa.username=syncope
+jpa.password=syncope
+jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary
+jpa.pool.validationQuery=SELECT 1
+#note: other connection pool settings can also be configured here, see persistenceContext.xml
+quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate
+quartz.scheduler.idleWaitTime=5000
+quartz.sql=tables_sqlServer.sql
+audit.sql=audit_sqlserver.sql
+database.schema=
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPAUserDAO.java b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPAUserDAO.java
index 3b79045..1ed36e1 100644
--- a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPAUserDAO.java
+++ b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPAUserDAO.java
@@ -124,7 +124,7 @@ public class JPAUserDAO extends AbstractSubjectDAO<UPlainAttr, UDerAttr, UVirAtt
@Override
public User findByToken(final String token) {
TypedQuery<User> query = entityManager.createQuery("SELECT e FROM " + JPAUser.class.getSimpleName()
- + " e WHERE e.token = :token", User.class);
+ + " e WHERE e.token LIKE :token", User.class);
query.setParameter("token", token);
User result = null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/40892e19/syncope620/server/persistence-jpa/src/main/resources/quartz/tables_mariadb.sql
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/main/resources/quartz/tables_mariadb.sql b/syncope620/server/persistence-jpa/src/main/resources/quartz/tables_mariadb.sql
new file mode 100644
index 0000000..ebb8e59
--- /dev/null
+++ b/syncope620/server/persistence-jpa/src/main/resources/quartz/tables_mariadb.sql
@@ -0,0 +1,206 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you 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.
+
+--
+-- Quartz seems to work best with the driver mm.mysql-2.0.7-bin.jar
+--
+-- PLEASE consider using mysql with innodb tables to avoid locking issues
+--
+-- In your Quartz properties file, you'll need to set
+-- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+--
+
+BEGIN;
+DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
+DROP TABLE IF EXISTS QRTZ_LOCKS;
+DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
+DROP TABLE IF EXISTS QRTZ_CALENDARS;
+COMMIT;
+
+
+BEGIN;
+CREATE TABLE QRTZ_JOB_DETAILS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ JOB_CLASS_NAME VARCHAR(250) NOT NULL,
+ IS_DURABLE VARCHAR(1) NOT NULL,
+ IS_NONCONCURRENT VARCHAR(1) NOT NULL,
+ IS_UPDATE_DATA VARCHAR(1) NOT NULL,
+ REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
+ JOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ NEXT_FIRE_TIME BIGINT(13) NULL,
+ PREV_FIRE_TIME BIGINT(13) NULL,
+ PRIORITY INTEGER NULL,
+ TRIGGER_STATE VARCHAR(16) NOT NULL,
+ TRIGGER_TYPE VARCHAR(8) NOT NULL,
+ START_TIME BIGINT(13) NOT NULL,
+ END_TIME BIGINT(13) NULL,
+ CALENDAR_NAME VARCHAR(200) NULL,
+ MISFIRE_INSTR SMALLINT(2) NULL,
+ JOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+ REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_SIMPLE_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ REPEAT_COUNT BIGINT(7) NOT NULL,
+ REPEAT_INTERVAL BIGINT(12) NOT NULL,
+ TIMES_TRIGGERED BIGINT(10) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_CRON_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ CRON_EXPRESSION VARCHAR(200) NOT NULL,
+ TIME_ZONE_ID VARCHAR(80),
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_SIMPROP_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ STR_PROP_1 VARCHAR(512) NULL,
+ STR_PROP_2 VARCHAR(512) NULL,
+ STR_PROP_3 VARCHAR(512) NULL,
+ INT_PROP_1 INT NULL,
+ INT_PROP_2 INT NULL,
+ LONG_PROP_1 BIGINT NULL,
+ LONG_PROP_2 BIGINT NULL,
+ DEC_PROP_1 NUMERIC(13,4) NULL,
+ DEC_PROP_2 NUMERIC(13,4) NULL,
+ BOOL_PROP_1 VARCHAR(1) NULL,
+ BOOL_PROP_2 VARCHAR(1) NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_BLOB_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ BLOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_CALENDARS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ CALENDAR_NAME VARCHAR(200) NOT NULL,
+ CALENDAR BLOB NOT NULL,
+ PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_FIRED_TRIGGERS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ ENTRY_ID VARCHAR(95) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ FIRED_TIME BIGINT(13) NOT NULL,
+ SCHED_TIME BIGINT(13) NOT NULL,
+ PRIORITY INTEGER NOT NULL,
+ STATE VARCHAR(16) NOT NULL,
+ JOB_NAME VARCHAR(200) NULL,
+ JOB_GROUP VARCHAR(200) NULL,
+ IS_NONCONCURRENT VARCHAR(1) NULL,
+ REQUESTS_RECOVERY VARCHAR(1) NULL,
+ PRIMARY KEY (SCHED_NAME,ENTRY_ID)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_SCHEDULER_STATE
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
+ CHECKIN_INTERVAL BIGINT(13) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
+);
+COMMIT;
+
+BEGIN;
+CREATE TABLE QRTZ_LOCKS
+ (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ LOCK_NAME VARCHAR(40) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,LOCK_NAME)
+);
+COMMIT;