Example usage for org.hibernate.proxy HibernateProxyHelper getClassWithoutInitializingProxy

List of usage examples for org.hibernate.proxy HibernateProxyHelper getClassWithoutInitializingProxy

Introduction

In this page you can find the example usage for org.hibernate.proxy HibernateProxyHelper getClassWithoutInitializingProxy.

Prototype

public static Class getClassWithoutInitializingProxy(Object object) 

Source Link

Document

Get the class of an instance or the underlying class of a proxy (without initializing the proxy!).

Usage

From source file:org.compass.core.util.proxy.extractor.HibernateProxyExtractor.java

License:Apache License

public Class getTargetClass(Object obj) {
    if (obj instanceof HibernateProxy) {
        return HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    }/*from   ww  w. j  a v  a  2  s  .  c o m*/
    return obj.getClass();
}

From source file:org.dspace.authorize.ResourcePolicy.java

License:BSD License

/**
 * Return true if this object equals obj, false otherwise.
 *
 * @param obj/*  w w w . ja  va  2  s.  c  om*/
 * @return true if ResourcePolicy objects are equal
 */
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    if (getClass() != objClass) {
        return false;
    }
    final ResourcePolicy other = (ResourcePolicy) obj;
    if (getAction() != other.getAction()) {
        return false;
    }
    if (!ObjectUtils.equals(getEPerson(), other.getEPerson())) {
        return false;
    }
    if (!ObjectUtils.equals(getGroup(), other.getGroup())) {
        return false;
    }
    if (!ObjectUtils.equals(getStartDate(), other.getStartDate())) {
        return false;
    }
    if (!ObjectUtils.equals(getEndDate(), other.getEndDate())) {
        return false;
    }
    return true;
}

From source file:org.dspace.content.Bitstream.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same Bitstream
 * as this object, <code>false</code> otherwise
 *
 * @param other//  w w w  .j  a v  a  2 s  .  c  o m
 *            object to compare to
 *
 * @return <code>true</code> if object passed in represents the same
 *         collection as this object
 */
@Override
public boolean equals(Object other) {
    if (other == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
    if (this.getClass() != objClass) {
        return false;
    }
    final Bitstream otherBitstream = (Bitstream) other;
    if (!this.getID().equals(otherBitstream.getID())) {
        return false;
    }

    return true;
}

From source file:org.dspace.content.BitstreamFormat.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same Collection
 * as this object, <code>false</code> otherwise
 *
 * @param other/*  w w w.ja v  a 2 s  .  c o  m*/
 *            object to compare to
 *
 * @return <code>true</code> if object passed in represents the same
 *         collection as this object
 */
@Override
public boolean equals(Object other) {
    if (other == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
    if (this.getClass() != objClass) {
        return false;
    }
    final BitstreamFormat otherBitstreamFormat = (BitstreamFormat) other;
    if (this.getID() != otherBitstreamFormat.getID()) {
        return false;
    }

    return true;
}

From source file:org.dspace.content.Bundle.java

License:BSD License

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from   w ww.ja v a  2  s . c o  m*/
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    if (this.getClass() != objClass) {
        return false;
    }
    final Bundle other = (Bundle) obj;
    if (this.getType() != other.getType()) {
        return false;
    }
    if (!this.getID().equals(other.getID())) {
        return false;
    }
    return true;
}

From source file:org.dspace.content.Collection.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same Collection
 * as this object, <code>false</code> otherwise
 *
 * @param other//from   w  w w. j a v  a  2  s.  c  o m
 *            object to compare to
 *
 * @return <code>true</code> if object passed in represents the same
 *         collection as this object
 */
@Override
public boolean equals(Object other) {
    if (other == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
    if (this.getClass() != objClass) {
        return false;
    }
    final Collection otherCollection = (Collection) other;
    if (!this.getID().equals(otherCollection.getID())) {
        return false;
    }

    return true;
}

From source file:org.dspace.content.Community.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same Community
 * as this object, <code>false</code> otherwise
 * /*from ww  w . ja va 2 s  .co  m*/
 * @param other
 *            object to compare to
 * 
 * @return <code>true</code> if object passed in represents the same
 *         community as this object
 */
@Override
public boolean equals(Object other) {
    if (other == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
    if (this.getClass() != objClass) {
        return false;
    }
    final Community otherCommunity = (Community) other;
    if (!this.getID().equals(otherCommunity.getID())) {
        return false;
    }

    return true;
}

From source file:org.dspace.content.Item.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same Item as
 * this object, <code>false</code> otherwise
 *
 * @param obj/*from w ww.  j a  va  2s .  co  m*/
 *            object to compare to
 * @return <code>true</code> if object passed in represents the same item
 *         as this object
 */
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    if (this.getClass() != objClass) {
        return false;
    }
    final Item otherItem = (Item) obj;
    if (!this.getID().equals(otherItem.getID())) {
        return false;
    }

    return true;
}

From source file:org.dspace.content.MetadataField.java

License:BSD License

/**
 * Return <code>true</code> if <code>other</code> is the same MetadataField
 * as this object, <code>false</code> otherwise
 *
 * @param obj/*from   w  w  w  .j  a  va 2  s. c om*/
 *            object to compare to
 *
 * @return <code>true</code> if object passed in represents the same
 *         MetadataField as this object
 */
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    if (getClass() != objClass) {
        return false;
    }
    final MetadataField other = (MetadataField) obj;
    if (this.getFieldID() != other.getFieldID()) {
        return false;
    }
    if (!getMetadataSchema().equals(other.getMetadataSchema())) {
        return false;
    }
    return true;
}

From source file:org.dspace.content.MetadataSchema.java

License:BSD License

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from w  w w  .  j a v a2s . c o  m
    Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
    if (getClass() != objClass) {
        return false;
    }
    final MetadataSchema other = (MetadataSchema) obj;
    if (this.id != other.id) {
        return false;
    }
    if ((this.namespace == null) ? (other.namespace != null) : !this.namespace.equals(other.namespace)) {
        return false;
    }
    return true;
}