Codota Logo
WrapperPolicy
Code IndexAdd Codota to your IDE (free)

How to use
WrapperPolicy
in
org.eclipse.persistence.descriptors

Best Java code snippets using org.eclipse.persistence.descriptors.WrapperPolicy (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Wrap the object if required.
 * This is used for the wrapper policy support and EJB.
 */
public Object wrapObject(Object implementation, AbstractSession session) {
  if (!this.hasWrapperPolicy) {
    return implementation;
  }
  if (implementation == null) {
    return null;
  }
  // PERF: Using direct variable access.
  
  // Check if already wrapped.
  if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) {
    return implementation;
  }
  // Allow for inheritance, the concrete wrapper must always be used.
  if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) {
    ClassDescriptor descriptor = session.getDescriptor(implementation);
    if (descriptor != this.descriptor) {
      return descriptor.getObjectBuilder().wrapObject(implementation, session);
    }
  }
  return this.descriptor.getWrapperPolicy().wrapObject(implementation, session);
}
 
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * ADVANCED:
 * Sets the WrapperPolicy for this descriptor.
 * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs.
 */
public void setWrapperPolicy(WrapperPolicy wrapperPolicy) {
  this.wrapperPolicy = wrapperPolicy;
  // For bug 2766379 must be able to set the wrapper policy back to default
  // which is null.
  if (wrapperPolicy != null) {
    wrapperPolicy.setDescriptor(this);
  }
  getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Unwrap the object if required.
 * This is used for the wrapper policy support and EJB.
 */
public Object unwrapObject(Object proxy, AbstractSession session) {
  if (!this.hasWrapperPolicy) {
    return proxy;
  }
  if (proxy == null) {
    return null;
  }
  // PERF: Using direct variable access.
  // Check if already unwrapped.
  if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) {
    if (session.getProject().hasProxyIndirection()) {
      //Bug#3947714  Check and trigger the proxy here
      return ProxyIndirectionPolicy.getValueFromProxy(proxy);
    }
    return proxy;
  }
  // Allow for inheritance, the concrete wrapper must always be used.
  if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) {
    ClassDescriptor descriptor = session.getDescriptor(proxy);
    if (descriptor != this.descriptor) {
      return descriptor.getObjectBuilder().unwrapObject(proxy, session);
    }
  }
  return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session);        
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  Object object = cp.next(iterator, cloningSession);
  if (mapping.getReferenceDescriptor().hasWrapperPolicy()) {
    object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, cloningSession);
objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, cloningSession);
origin: org.eclipse.persistence/org.eclipse.persistence.core

if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

getWrapperPolicy().initialize(session);
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Unwrap the object if required.
 * This is used for the wrapper policy support and EJB.
 */
public Object unwrapObject(Object proxy, AbstractSession session) {
  if (!this.hasWrapperPolicy) {
    return proxy;
  }
  if (proxy == null) {
    return null;
  }
  // PERF: Using direct variable access.
  // Check if already unwrapped.
  if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) {
    if (session.getProject().hasProxyIndirection()) {
      //Bug#3947714  Check and trigger the proxy here
      return ProxyIndirectionPolicy.getValueFromProxy(proxy);
    }
    return proxy;
  }
  // Allow for inheritance, the concrete wrapper must always be used.
  if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) {
    ClassDescriptor descriptor = session.getDescriptor(proxy);
    if (descriptor != this.descriptor) {
      return descriptor.getObjectBuilder().unwrapObject(proxy, session);
    }
  }
  return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session);
}
origin: com.haulmont.thirdparty/eclipselink

  Object object = cp.next(iterator, cloningSession);
  if (mapping.getReferenceDescriptor().hasWrapperPolicy()) {
    object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, cloningSession);
objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, cloningSession);
origin: com.haulmont.thirdparty/eclipselink

if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
origin: com.haulmont.thirdparty/eclipselink

getWrapperPolicy().initialize(session);
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Wrap the object if required.
 * This is used for the wrapper policy support and EJB.
 */
public Object wrapObject(Object implementation, AbstractSession session) {
  if (!this.hasWrapperPolicy) {
    return implementation;
  }
  if (implementation == null) {
    return null;
  }
  // PERF: Using direct variable access.
  // Check if already wrapped.
  if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) {
    return implementation;
  }
  // Allow for inheritance, the concrete wrapper must always be used.
  if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) {
    ClassDescriptor descriptor = session.getDescriptor(implementation);
    if (descriptor != this.descriptor) {
      return descriptor.getObjectBuilder().wrapObject(implementation, session);
    }
  }
  return this.descriptor.getWrapperPolicy().wrapObject(implementation, session);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Unwrap the object if required.
 * This is used for the wrapper policy support and EJB.
 */
public Object unwrapObject(Object proxy, AbstractSession session) {
  if (!this.hasWrapperPolicy) {
    return proxy;
  }
  if (proxy == null) {
    return null;
  }
  // PERF: Using direct variable access.
  // Check if already unwrapped.
  if ((!this.descriptor.hasWrapperPolicy()) || (this.descriptor.getJavaClass() == proxy.getClass()) || (!this.descriptor.getWrapperPolicy().isWrapped(proxy))) {
    if (session.getProject().hasProxyIndirection()) {
      //Bug#3947714  Check and trigger the proxy here
      return ProxyIndirectionPolicy.getValueFromProxy(proxy);
    }
    return proxy;
  }
  // Allow for inheritance, the concrete wrapper must always be used.
  if (this.descriptor.hasInheritance() && (this.descriptor.getInheritancePolicy().hasChildren())) {
    ClassDescriptor descriptor = session.getDescriptor(proxy);
    if (descriptor != this.descriptor) {
      return descriptor.getObjectBuilder().unwrapObject(proxy, session);
    }
  }
  return this.descriptor.getWrapperPolicy().unwrapObject(proxy, session);        
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  Object object = cp.next(iterator, session);
  if (mapping.getReferenceDescriptor().hasWrapperPolicy()) {
    object = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(object, session);
objectToLock = mapping.getReferenceDescriptor().getWrapperPolicy().unwrapObject(objectToLock, session);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * ADVANCED:
 * Sets the WrapperPolicy for this descriptor.
 * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs.
 */
public void setWrapperPolicy(WrapperPolicy wrapperPolicy) {
  this.wrapperPolicy = wrapperPolicy;
  // For bug 2766379 must be able to set the wrapper policy back to default
  // which is null.
  if (wrapperPolicy != null) {
    wrapperPolicy.setDescriptor(this);
  }
  getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (this.descriptor.hasWrapperPolicy() && this.descriptor.getWrapperPolicy().isWrapped(clone)) {
origin: org.eclipse.persistence/org.eclipse.persistence.core

getWrapperPolicy().initialize(session);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * Wrap the object if required.
   * This is used for the wrapper policy support and EJB.
   */
  public Object wrapObject(Object implementation, AbstractSession session) {
    if (!this.hasWrapperPolicy) {
      return implementation;
    }
    if (implementation == null) {
      return null;
    }
    // PERF: Using direct variable access.
    
    // Check if already wrapped.
    if ((!this.descriptor.hasWrapperPolicy()) || this.descriptor.getWrapperPolicy().isWrapped(implementation)) {
      return implementation;
    }

    // Allow for inheritance, the concrete wrapper must always be used.
    if (this.descriptor.hasInheritance() && this.descriptor.getInheritancePolicy().hasChildren() && (implementation.getClass() != this.descriptor.getJavaClass())) {
      ClassDescriptor descriptor = session.getDescriptor(implementation);
      if (descriptor != this.descriptor) {
        return descriptor.getObjectBuilder().wrapObject(implementation, session);
      }
    }
    return this.descriptor.getWrapperPolicy().wrapObject(implementation, session);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

m_parentDescriptor.getWrapperPolicy().unwrapObject(parentObj, uow);   
origin: com.haulmont.thirdparty/eclipselink

/**
 * ADVANCED:
 * Sets the WrapperPolicy for this descriptor.
 * This advanced feature can be used to wrap objects with other classes such as CORBA TIE objects or EJBs.
 */
public void setWrapperPolicy(WrapperPolicy wrapperPolicy) {
  this.wrapperPolicy = wrapperPolicy;
  // For bug 2766379 must be able to set the wrapper policy back to default
  // which is null.
  if (wrapperPolicy != null) {
    wrapperPolicy.setDescriptor(this);
  }
  getObjectBuilder().setHasWrapperPolicy(wrapperPolicy != null);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

m_parentDescriptor.getWrapperPolicy().unwrapObject(parentObj, uow);
org.eclipse.persistence.descriptorsWrapperPolicy

Javadoc

Purpose: The wrapper policy can be used to wrap all objects read from the database in another object. This allows for EclipseLink to utilize one version of the class for its purposes and allows for the application to deal with another version of the object. The wrapper policy is used for things such as EJB Entity Beans and is directly used by the TopLink for WebLogic product for EJB Container Managed Persistence. It is assumed that relationships must be through the wrapper objects. Object identity is not maintained on the wrapper objects, only the wrapped object.

Most used methods

  • initialize
    PUBLIC: Required: Lets the policy perform initialization.
  • isWrapped
    PUBLIC: Required: Return true if the object is already wrapped.
  • setDescriptor
    PUBLIC: Required: Set the descriptor.
  • unwrapObject
    PUBLIC: Required: Unwrap the object to return the implementation that is meant to be used by Eclipse
  • wrapObject
    PUBLIC: Required: Wrap the object to return the implementation that the application requires. The ob

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • ImageIO (javax.imageio)
  • JFileChooser (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now