Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code cleanup, trying to handle corner cases (container id not present…
… in delta for delete/replace)
- Loading branch information
Showing
17 changed files
with
786 additions
and
387 deletions.
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
...ql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/mapper/ActivationMapper.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,41 @@ | ||
/* | ||
* 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.helpers.mapper; | ||
|
||
import com.evolveum.midpoint.repo.sql.data.common.embedded.RActivation; | ||
import com.evolveum.midpoint.repo.sql.helpers.modify.MapperContext; | ||
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException; | ||
import com.evolveum.midpoint.util.exception.SystemException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class ActivationMapper implements Mapper<ActivationType, RActivation> { | ||
|
||
@Override | ||
public RActivation map(ActivationType input, MapperContext context) { | ||
try { | ||
RActivation ractivation = new RActivation(); | ||
RActivation.copyFromJAXB(input, ractivation, null); | ||
|
||
return ractivation; | ||
} catch (DtoTranslationException ex) { | ||
throw new SystemException("Couldn't translate activation to entity", ex); | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...ql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/mapper/AssignmentMapper.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,49 @@ | ||
/* | ||
* 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.helpers.mapper; | ||
|
||
import com.evolveum.midpoint.repo.sql.data.RepositoryContext; | ||
import com.evolveum.midpoint.repo.sql.data.common.RObject; | ||
import com.evolveum.midpoint.repo.sql.data.common.container.RAssignment; | ||
import com.evolveum.midpoint.repo.sql.helpers.modify.MapperContext; | ||
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException; | ||
import com.evolveum.midpoint.util.exception.SystemException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class AssignmentMapper extends ContainerMapper<AssignmentType, RAssignment> { | ||
|
||
@Override | ||
public RAssignment map(AssignmentType input, MapperContext context) { | ||
RAssignment ass = new RAssignment(); | ||
|
||
RObject owner = (RObject) context.getOwner(); | ||
|
||
RepositoryContext repositoryContext = | ||
new RepositoryContext(context.getRepositoryService(), context.getPrismContext()); | ||
|
||
try { | ||
RAssignment.copyFromJAXB(input, ass, owner, repositoryContext); | ||
} catch (DtoTranslationException ex) { | ||
throw new SystemException("Couldn't translate assignment to entity", ex); | ||
} | ||
|
||
return ass; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ain/java/com/evolveum/midpoint/repo/sql/helpers/mapper/AutoassignSpecificationMapper.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,34 @@ | ||
/* | ||
* 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.helpers.mapper; | ||
|
||
import com.evolveum.midpoint.repo.sql.data.common.embedded.RAutoassignSpecification; | ||
import com.evolveum.midpoint.repo.sql.helpers.modify.MapperContext; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AutoassignSpecificationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class AutoassignSpecificationMapper implements Mapper<AutoassignSpecificationType, RAutoassignSpecification> { | ||
|
||
@Override | ||
public RAutoassignSpecification map(AutoassignSpecificationType input, MapperContext context) { | ||
RAutoassignSpecification rspec = new RAutoassignSpecification(); | ||
RAutoassignSpecification.copyFromJAXB(input, rspec); | ||
return rspec; | ||
} | ||
} |
Oops, something went wrong.