Skip to content

Commit

Permalink
repository deprecated annotations cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 7, 2018
1 parent dd17eff commit d8972d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
Expand Up @@ -29,7 +29,6 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;

import org.apache.commons.lang.Validate;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Persister;
Expand All @@ -46,7 +45,7 @@
@Entity
@IdClass(RObjectReferenceId.class)
@Table(name = "m_reference", indexes = {
@javax.persistence.Index(name = "iReferenceTargetOid", columnList = "targetOid")
@Index(name = "iReferenceTargetOid", columnList = "targetOid")
})
@Persister(impl = MidPointSingleTablePersister.class)
public class RObjectReference<T extends RObject> implements ObjectReference, EntityState {
Expand Down Expand Up @@ -84,7 +83,7 @@ public void setTransient(Boolean trans) {
this.trans = trans;
}

@ForeignKey(name = "fk_reference_owner")
@JoinColumn(foreignKey = @ForeignKey(name = "fk_reference_owner"))
@MapsId("owner")
@ManyToOne(fetch = FetchType.LAZY)
@NotQueryable
Expand All @@ -102,10 +101,9 @@ public String getOwnerOid() {
return ownerOid;
}

//@MapsId("target")
@ForeignKey(name="none")
@ManyToOne(fetch = FetchType.LAZY, optional = true, targetEntity = RObject.class)
@JoinColumn(referencedColumnName = "oid", updatable = false, insertable = false, nullable = true)
@JoinColumn(referencedColumnName = "oid", updatable = false, insertable = false, nullable = true,
foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@NotFound(action = NotFoundAction.IGNORE)
@NotQueryable
public T getTarget() {
Expand Down
Expand Up @@ -22,26 +22,14 @@
import com.evolveum.midpoint.repo.sql.data.common.other.RObjectType;
import com.evolveum.midpoint.repo.sql.query2.definition.NotQueryable;
import com.evolveum.midpoint.repo.sql.util.ClassMapper;
import com.evolveum.midpoint.repo.sql.util.RUtil;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.xml.namespace.QName;
import javax.persistence.*;

import static com.evolveum.midpoint.repo.sql.util.RUtil.*;
import static com.evolveum.midpoint.schema.util.ObjectTypeUtil.*;
Expand All @@ -65,10 +53,8 @@ public String getRelation() {
return relation;
}

//@MapsId("target")
@ForeignKey(name="none")
@ManyToOne(fetch = FetchType.LAZY, optional = true)
@JoinColumn(referencedColumnName = "oid", updatable = false, insertable = false, nullable = true)
@JoinColumn(referencedColumnName = "oid", updatable = false, insertable = false, nullable = true, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@NotFound(action = NotFoundAction.IGNORE)
@NotQueryable
public RObject getTarget() {
Expand Down

0 comments on commit d8972d8

Please sign in to comment.