Skip to content

Commit

Permalink
Revert "MID-3335 introduced subtype"
Browse files Browse the repository at this point in the history
This reverts commit 3a83dfe
  • Loading branch information
1azyman committed Feb 20, 2018
1 parent 230188f commit 81ae3fb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,6 @@
</xsd:annotation>
</xsd:element>

<xsd:element name="subType" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
<p>
Type of the object. It is used to distinguish what a specific object
represents. Whether it is a different kind of organizational unit, project,
team, or different kind of user, etc.
</p>
</xsd:documentation>
<xsd:appinfo>
<a:displayName>ObjectType.subType</a:displayName>
<a:displayOrder>15</a:displayOrder>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>

<xsd:element name="fetchResult" type="tns:OperationResultType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Expand Down Expand Up @@ -3048,15 +3032,10 @@
reasons it is used in a more generic way to mean general type of user.
Therefore it can be used to distinguish employees from customers, etc.
</p>
<p>
DEPRECATED: Use ObjectType.subType
</p>
</xsd:documentation>
<xsd:appinfo>
<a:displayName>UserType.employeeType</a:displayName>
<a:displayOrder>410</a:displayOrder>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>3.8</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down Expand Up @@ -11099,14 +11078,9 @@
<li>asset</li>
</ul>
</p>
<p>
DEPRECATED: use ObjectType.subType
</p>
</xsd:documentation>
<xsd:appinfo>
<a:displayName>RoleType.roleType</a:displayName>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>3.8</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down Expand Up @@ -11557,15 +11531,10 @@
<li>realm</li>
</ul>
</p>
<p>
DEPRECATED: Use ObjectType.subType
</p>
</xsd:documentation>
<xsd:appinfo>
<a:displayName>OrgType.type</a:displayName>
<a:displayOrder>120</a:displayOrder>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>3.8</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down Expand Up @@ -11722,15 +11691,10 @@
<li>device</li>
</ul>
</p>
<p>
DEPRECATED: Use ObjectType.subType
</p>
</xsd:documentation>
<xsd:appinfo>
<a:displayName>ServiceType.type</a:displayName>
<a:displayOrder>120</a:displayOrder>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>3.8</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.hibernate.annotations.*;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.datatype.XMLGregorianCalendar;
import java.io.Serializable;
import java.util.Collection;
Expand Down Expand Up @@ -152,7 +159,6 @@ public abstract class RObject<T extends ObjectType> implements Metadata<RObjectR
private RObjectType objectTypeClass;
//ObjectType searchable fields
private RPolyString name;
private Set<String> subType;
private Set<RObjectReference<ROrg>> parentOrgRef;
private Set<RTrigger> trigger;
private REmbeddedReference tenantRef;
Expand Down Expand Up @@ -418,19 +424,6 @@ public RObjectType getObjectTypeClass() {
return objectTypeClass;
}

@ElementCollection
@CollectionTable(name = "m_object_subtype", joinColumns = {
@JoinColumn(name = "object_oid", referencedColumnName = "oid", foreignKey = @javax.persistence.ForeignKey(name = "fk_object_subtype"))
})
@Cascade({org.hibernate.annotations.CascadeType.ALL})
public Set<String> getSubType() {
return subType;
}

public void setSubType(Set<String> subType) {
this.subType = subType;
}

@Transient
public Boolean isTransient() {
return trans;
Expand Down Expand Up @@ -644,7 +637,6 @@ public boolean equals(Object o) {
return false;
if (textInfoItems != null ? !textInfoItems.equals(rObject.textInfoItems) : rObject.textInfoItems != null) return false;
if (operationExecutions != null ? !operationExecutions.equals(rObject.operationExecutions) : rObject.operationExecutions != null) return false;
if (subType != null ? !subType.equals(rObject.subType) : rObject.subType != null) return false;

return true;
}
Expand All @@ -667,17 +659,15 @@ public int hashCode() {

@Deprecated
protected static <T extends ObjectType> void copyToJAXB(RObject<T> repo, ObjectType jaxb, PrismContext prismContext,
Collection<SelectorOptions<GetOperationOptions>> options) {
Collection<SelectorOptions<GetOperationOptions>> options)
throws DtoTranslationException {
Validate.notNull(repo, "Repo object must not be null.");
Validate.notNull(jaxb, "JAXB object must not be null.");

jaxb.setName(RPolyString.copyToJAXB(repo.getName()));
jaxb.setOid(repo.getOid());
jaxb.setVersion(Integer.toString(repo.getVersion()));
jaxb.setLifecycleState(repo.getLifecycleState());
if (repo.getSubType() != null) {
jaxb.getSubType().addAll(repo.getSubType());
}

if (SelectorOptions.hasToLoadPath(ObjectType.F_PARENT_ORG_REF, options)) {
List orgRefs = RUtil.safeSetReferencesToList(repo.getParentOrgRef(), prismContext);
Expand All @@ -700,8 +690,6 @@ public static <T extends ObjectType> void copyFromJAXB(ObjectType jaxb, RObject<
repo.setName(RPolyString.copyFromJAXB(jaxb.getName()));
repo.setLifecycleState(jaxb.getLifecycleState());

repo.setSubType(RUtil.listToSet(jaxb.getSubType()));

String strVersion = jaxb.getVersion();
int version = StringUtils.isNotEmpty(strVersion) && strVersion.matches("[0-9]*") ? Integer.parseInt(jaxb
.getVersion()) : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
public class ROrg extends RAbstractRole<OrgType> {

private RPolyString nameCopy;
@Deprecated //todo remove collection in 3.9
private Set<String> orgType;
private String costCenter;
private RPolyString locality;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
public class RRole extends RAbstractRole<RoleType> {

private RPolyString nameCopy;
@Deprecated //todo remove in 3.9
private String roleType;

public String getRoleType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
public class RService extends RAbstractRole<ServiceType> {

private RPolyString nameCopy;
@Deprecated //todo remove collection in 3.9
private Set<String> serviceType;
private RPolyString locality;
private Integer displayOrder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public class RUser extends RFocus<UserType> implements OperationResult {
private String emailAddress;
private String telephoneNumber;
private String employeeNumber;
@Deprecated //todo remove collection in 3.9
private Set<String> employeeType;
private Set<RPolyString> organizationalUnit;
private RPolyString localityUser;
Expand Down

0 comments on commit 81ae3fb

Please sign in to comment.