Skip to content

Commit

Permalink
repo: more useless parameter types cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 3, 2020
1 parent 86da91a commit 5273218
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 118 deletions.
Expand Up @@ -1860,7 +1860,7 @@ public void test410AddShadow() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "jack", "jim");
Expand Down Expand Up @@ -1891,7 +1891,7 @@ public void test420AddVisibleAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "jack", "jim", "alice", "bob");
Expand Down Expand Up @@ -1932,7 +1932,7 @@ public void test425AddVisibleAttributeValuesDuplicate() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "jack", "jim", "alice", "bob");
Expand Down Expand Up @@ -1963,7 +1963,7 @@ public void test426ReplaceVisibleAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "bob", "chuck");
Expand Down Expand Up @@ -1998,7 +1998,7 @@ public void test427DeleteVisibleAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName);
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "bob", "chuck");
Expand Down Expand Up @@ -2048,7 +2048,7 @@ public void test428DeleteAlreadyLoadedVisibleAttributeValue() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2085,7 +2085,7 @@ public void test430AddHiddenAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "banderson", "kwhite", "tbrown", "jsmith");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2126,7 +2126,7 @@ public void test432AddHiddenAttributeValuesDuplicate() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "banderson", "kwhite", "tbrown", "jsmith");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2175,7 +2175,7 @@ public void test435DeleteHiddenAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2221,7 +2221,7 @@ public void test436DeleteHiddenAttributeValuesDuplicate() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2265,7 +2265,7 @@ public void test440ReplaceHiddenAttributeValues() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "ALUMNI");
assertExtension(s, itemMember, "alice", "bob");
assertExtension(s, itemManager, "chuck");
Expand Down Expand Up @@ -2306,7 +2306,7 @@ public void test450DeleteWholeContainer() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName);
assertExtension(s, itemMember);
assertExtension(s, itemManager);
Expand Down Expand Up @@ -2357,7 +2357,7 @@ public void test455AddWholeContainer() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni");
assertExtension(s, itemMember, "banderson", "kwhite");
assertExtension(s, itemManager, "jack", "jim");
Expand Down Expand Up @@ -2429,7 +2429,7 @@ public void test458AddWholeContainerDifferentValue() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni2");
assertExtension(s, itemMember, "banderson2", "kwhite2");
assertExtension(s, itemManager, "jack2", "jim2");
Expand Down Expand Up @@ -2499,7 +2499,7 @@ public void test460ReplaceWholeContainer() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName, "alumni3");
assertExtension(s, itemMember, "banderson3", "kwhite3");
assertExtension(s, itemManager, "jack3", "jim3");
Expand Down Expand Up @@ -2557,7 +2557,7 @@ public void test465ReplaceWholeContainerToNull() throws Exception {
queryListener.dumpAndStop();

try (Session session = factory.openSession()) {
RShadow<?> s = session.get(RShadow.class, shadowOid);
RShadow s = session.get(RShadow.class, shadowOid);
assertExtension(s, itemGroupName);
assertExtension(s, itemMember);
assertExtension(s, itemManager);
Expand Down
Expand Up @@ -7,32 +7,29 @@

package com.evolveum.midpoint.repo.sql.data.common;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Persister;
import org.hibernate.annotations.Where;

import com.evolveum.midpoint.repo.sql.data.RepositoryContext;
import com.evolveum.midpoint.repo.sql.data.common.container.RAssignment;
import com.evolveum.midpoint.repo.sql.data.common.embedded.RAutoassignSpecification;
import com.evolveum.midpoint.repo.sql.data.common.embedded.REmbeddedReference;
import com.evolveum.midpoint.repo.sql.data.common.embedded.RPolyString;
import com.evolveum.midpoint.repo.sql.data.common.other.RAssignmentOwner;
import com.evolveum.midpoint.repo.sql.data.common.other.RReferenceOwner;
import com.evolveum.midpoint.repo.sql.query.definition.JaxbName;
import com.evolveum.midpoint.repo.sql.query.definition.QueryEntity;
import com.evolveum.midpoint.repo.sql.query.definition.VirtualCollection;
import com.evolveum.midpoint.repo.sql.query.definition.VirtualQueryParam;
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException;
import com.evolveum.midpoint.repo.sql.util.IdGeneratorResult;
import com.evolveum.midpoint.repo.sql.util.MidPointJoinedPersister;
import com.evolveum.midpoint.repo.sql.util.RUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
import org.hibernate.annotations.*;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.HashSet;
import java.util.Set;

/**
* @author lazyman
Expand All @@ -41,7 +38,7 @@
@VirtualCollection(jaxbName = @JaxbName(localPart = "inducement"), jaxbType = Set.class,
jpaName = "assignments", jpaType = Set.class, additionalParams = {
@VirtualQueryParam(name = "assignmentOwner", type = RAssignmentOwner.class,
value = "ABSTRACT_ROLE")}, collectionType = RAssignment.class)})
value = "ABSTRACT_ROLE") }, collectionType = RAssignment.class) })

@Entity
@org.hibernate.annotations.ForeignKey(name = "fk_abstract_role")
Expand All @@ -51,7 +48,7 @@
@Index(name = "iAutoassignEnabled", columnList = "autoassign_enabled")
})
@Persister(impl = MidPointJoinedPersister.class)
public abstract class RAbstractRole<T extends AbstractRoleType> extends RFocus<T> {
public abstract class RAbstractRole extends RFocus {

private String identifier;
private String riskLevel;
Expand All @@ -68,7 +65,7 @@ public Boolean getRequestable() {
return requestable;
}

@Column(nullable = true)
@Column
public String getApprovalProcess() {
return approvalProcess;
}
Expand All @@ -80,7 +77,7 @@ public Set<RAssignment> getInducement() {

@Where(clause = RObjectReference.REFERENCE_TYPE + "= 3")
@OneToMany(mappedBy = "owner", orphanRemoval = true)
@Cascade({org.hibernate.annotations.CascadeType.ALL})
@Cascade({ org.hibernate.annotations.CascadeType.ALL })
public Set<RObjectReference<RFocus>> getApproverRef() {
if (approverRef == null) {
approverRef = new HashSet<>();
Expand Down Expand Up @@ -144,20 +141,21 @@ public void setAutoassign(RAutoassignSpecification autoassign) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;

RAbstractRole<?> that = (RAbstractRole<?>) o;

if (identifier != null ? !identifier.equals(that.identifier) : that.identifier != null) return false;
if (riskLevel != null ? !riskLevel.equals(that.riskLevel) : that.riskLevel != null) return false;
if (displayName != null ? !displayName.equals(that.displayName) : that.displayName != null) return false;
if (requestable != null ? !requestable.equals(that.requestable) : that.requestable != null) return false;
if (approverRef != null ? !approverRef.equals(that.approverRef) : that.approverRef != null) return false;
if (approvalProcess != null ? !approvalProcess.equals(that.approvalProcess) : that.approvalProcess != null)
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
if (!super.equals(o)) { return false; }

RAbstractRole that = (RAbstractRole) o;

if (identifier != null ? !identifier.equals(that.identifier) : that.identifier != null) { return false; }
if (riskLevel != null ? !riskLevel.equals(that.riskLevel) : that.riskLevel != null) { return false; }
if (displayName != null ? !displayName.equals(that.displayName) : that.displayName != null) { return false; }
if (requestable != null ? !requestable.equals(that.requestable) : that.requestable != null) { return false; }
if (approverRef != null ? !approverRef.equals(that.approverRef) : that.approverRef != null) { return false; }
if (approvalProcess != null ? !approvalProcess.equals(that.approvalProcess) : that.approvalProcess != null) {
return false;
if (ownerRef != null ? !ownerRef.equals(that.ownerRef) : that.ownerRef != null) return false;
}
if (ownerRef != null ? !ownerRef.equals(that.ownerRef) : that.ownerRef != null) { return false; }
return autoassign != null ? autoassign.equals(that.autoassign) : that.autoassign == null;
}

Expand All @@ -175,7 +173,7 @@ public int hashCode() {
}

// dynamically called
public static <T extends AbstractRoleType> void copyFromJAXB(AbstractRoleType jaxb, RAbstractRole<T> repo,
public static void copyFromJAXB(AbstractRoleType jaxb, RAbstractRole repo,
RepositoryContext repositoryContext, IdGeneratorResult generatorResult)
throws DtoTranslationException {

Expand Down
Expand Up @@ -30,7 +30,7 @@
@Table(indexes = {
@Index(name = "iArchetypeNameOrig", columnList = "name_orig"),
@Index(name = "iArchetypeNameNorm", columnList = "name_norm")})
public class RArchetype extends RAbstractRole<ArchetypeType> {
public class RArchetype extends RAbstractRole {

private RPolyString nameCopy;

Expand Down

0 comments on commit 5273218

Please sign in to comment.