Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize definitions in extension tables
Here we remove redundant item definition data (name, type, etc) from m_object_ext_XXX and m_assignment_ext_XXX tables. Currently repo tests pass, but provisioning ones do not. Also, there are some unfinished/temporary parts, like storing session into threadlocal variable; we also need to decide whether to implement equals/hashcode for ROExt* and RAExt* classes, etc.
- Loading branch information
Showing
55 changed files
with
1,598 additions
and
1,901 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/DeleteTestSimple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2010-2018 Evolveum | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package com.evolveum.midpoint.repo.sql; | ||
|
||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
import org.springframework.test.annotation.DirtiesContext; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* @author mederly | ||
*/ | ||
@ContextConfiguration(locations = {"../../../../../ctx-test.xml"}) | ||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) | ||
public class DeleteTestSimple extends BaseSQLRepoTest { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(DeleteTestSimple.class); | ||
|
||
@Test | ||
public void delete001() throws Exception { | ||
PrismObject<UserType> user = prismContext.parseObject(new File(FOLDER_BASIC, "user0.xml")); | ||
|
||
OperationResult result = new OperationResult("Delete Test"); | ||
String oid = repositoryService.addObject(user, null, result); | ||
LOGGER.info("*** deleteObject ***"); | ||
|
||
// Session session = open(); | ||
// CriteriaQuery<RAssignment> aQ = session.getCriteriaBuilder().createQuery(RAssignment.class); | ||
// aQ.select(aQ.from(RAssignment.class)); | ||
// List<RAssignment> aList = session.createQuery(aQ).getResultList(); | ||
// System.out.println("RAssignment: " + aList); | ||
// | ||
// CriteriaQuery<RAssignmentExtension> aeQ = session.getCriteriaBuilder().createQuery(RAssignmentExtension.class); | ||
// aeQ.select(aeQ.from(RAssignmentExtension.class)); | ||
// List<RAssignmentExtension> aeList = session.createQuery(aeQ).getResultList(); | ||
// System.out.println("RAssignmentExtension: " + aeList); | ||
// | ||
// CriteriaQuery<RAExtBoolean> aebQ = session.getCriteriaBuilder().createQuery(RAExtBoolean.class); | ||
// aebQ.select(aebQ.from(RAExtBoolean.class)); | ||
// List<RAExtBoolean> aebList = session.createQuery(aebQ).getResultList(); | ||
// System.out.println("RAExtBoolean: " + aebList); | ||
// | ||
// session.getTransaction().commit(); | ||
|
||
repositoryService.deleteObject(UserType.class, oid, result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
repo/repo-sql-impl-test/src/test/resources/basic/user0.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
~ Copyright (c) 2010-2018 Evolveum | ||
~ | ||
~ Licensed 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. | ||
--> | ||
|
||
<user> | ||
<name>user0</name> | ||
<assignment id="1"> | ||
<extension> | ||
<skipAutogeneration>true</skipAutogeneration> | ||
</extension> | ||
</assignment> | ||
</user> |
Oops, something went wrong.