Codota Logo
org.eclipse.persistence.descriptors
Code IndexAdd Codota to your IDE (free)

How to use org.eclipse.persistence.descriptors

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 import org.eclipse.persistence.config.DescriptorCustomizer;
import org.eclipse.persistence.descriptors.ClassDescriptor;

public class ShapeCustomizer implements DescriptorCustomizer {

  @Override
  public void customize(ClassDescriptor descriptor) throws Exception {
    descriptor.getInheritancePolicy().setClassIndicatorFieldName("@type");
  }
}
origin: com.sun.jersey/jersey-json

private Type getType(QName entity, boolean isAttribute, boolean isIndividual) {
  final XPathNodeWrapper currentNodeWrapper = getCurrentNodeWrapper();
  final ClassDescriptor classDescriptor = currentNodeWrapper == null ? null : currentNodeWrapper.getClassDescriptor();
  if (classDescriptor != null) {
    if (currentNodeWrapper.name.equals(entity)) {
      final Type containerType = getContainerType(isIndividual);
      return containerType != null ? containerType : classDescriptor.getJavaClass();
    } else {
      final EntityType entityType = currentNodeWrapper.getEntitiesTypesMap(isAttribute).get(entity.getLocalPart());
      return entityType == null ? null : entityType.type;
    }
  }
  return null;
}
origin: stackoverflow.com

 import org.eclipse.persistence.config.DescriptorCustomizer;
import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.mappings.DatabaseMapping;
import org.eclipse.persistence.oxm.mappings.XMLDirectMapping;
import org.eclipse.persistence.oxm.mappings.nullpolicy.XMLNullRepresentationType;

public class AddressCustomizer implements DescriptorCustomizer {

  @Override
  public void customize(ClassDescriptor descriptor) throws Exception {
    for(DatabaseMapping mapping : descriptor.getMappings()) {
      if(mapping.isAbstractDirectMapping()) {
        XMLDirectMapping xmlDirectMapping = (XMLDirectMapping) mapping;
        xmlDirectMapping.getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
        xmlDirectMapping.getNullPolicy().setNullRepresentedByEmptyNode(true);
      }
    }
  }

}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Return true if this descriptor should using an additional join expresison.
 */
public boolean shouldUseAdditionalJoinExpression() {
  // Return true, if the query manager has an additional join expression
  // and this descriptor is not part of an inheritance hierarchy using a
  // view (CR#3701077)
  return ((getQueryManager().getAdditionalJoinExpression() != null) && ! (hasInheritance() && getInheritancePolicy().hasView()));
}
origin: com.sun.jersey/jersey-json

final TreeObjectBuilder objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder();
origin: org.eclipse.persistence/org.eclipse.persistence.core

  /**
   * INTERNAL:
   * Return if the query has an non-default fetch group defined for itself.
   */
  protected boolean hasNonDefaultFetchGroup() {
    return this.descriptor.hasFetchGroupManager() && ((this.fetchGroup != null) || (this.fetchGroupName != null)
        || (!this.shouldUseDefaultFetchGroup && (this.descriptor.getFetchGroupManager().getDefaultFetchGroup() != null)));

  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Set the locking policy an all fields locking policy.
 * A field locking policy is base on locking on all fields by comparing with their previous values to detect field-level collisions.
 * Note: the unit of work must be used for all updates when using field locking.
 * @see AllFieldsLockingPolicy
 */
public void useAllFieldsLocking() {
  setOptimisticLockingPolicy(new AllFieldsLockingPolicy());
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the class of identity map to be used by this descriptor.
 * The default is the "SoftCacheWeakIdentityMap".
 */
public Class getRemoteIdentityMapClass() {
  return getCachePolicy().getRemoteIdentityMapClass();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Returns true if the descriptor represents an isolated class
 */
public boolean isProtectedIsolation() {
  return getCachePolicy().isProtectedIsolation();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @param fullyMergeEntity the fullyMergeEntity to set
 */
public void setFullyMergeEntity(boolean fullyMergeEntity) {
  getCachePolicy().setFullyMergeEntity(fullyMergeEntity);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  /**
   * INTERNAL:
   * Select one object of any concrete subclass.
   */
  @Override
  protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException {
    if (this.descriptor.isAbstract()) {
      return null;
    }
    return super.selectOneObject(query);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Set if the remote session cache hits on primary key read object queries is allowed or not.
 *
 * @see #disableCacheHitsOnRemote()
 */
public void setShouldDisableCacheHitsOnRemote(boolean shouldDisableCacheHitsOnRemote) {
  getCachePolicy().setShouldDisableCacheHitsOnRemote(shouldDisableCacheHitsOnRemote);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * This method returns <CODE>true</CODE> if the <CODE>ClassDescriptor</CODE> is configured to always remotely
 * refresh the cache if data is received from the database by any query in a {@link org.eclipse.persistence.sessions.remote.RemoteSession}.
 * Otherwise, it returns <CODE>false</CODE>.
 *
 * @see #setShouldAlwaysRefreshCacheOnRemote
 */
public boolean shouldAlwaysRefreshCacheOnRemote() {
  return getCachePolicy().shouldAlwaysRefreshCacheOnRemote();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the class of identity map to be used by this descriptor.
 * The default is the "SoftCacheWeakIdentityMap".
 */
public Class getIdentityMapClass() {
  return getCachePolicy().getIdentityMapClass();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Set the class of identity map to be the soft identity map.
 * This map uses soft references to only cache all object in-memory, until memory is low.
 * Note that "low" is interpreted differently by different JVM's.
 * The default is the "SoftCacheWeakIdentityMap".
 */
public void useSoftIdentityMap() {
  getCachePolicy().useSoftIdentityMap();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Set the class of identity map to be the hard cache weak identity map.
 * This map uses weak references to only cache object in-memory.
 * It also includes a secondary fixed sized soft cache to improve caching performance.
 * This is provided because some Java VM's do not implement soft references correctly.
 * The default is the "SoftCacheWeakIdentityMap".
 */
public void useRemoteHardCacheWeakIdentityMap() {
  getCachePolicy().setRemoteIdentityMapClass(ClassConstants.HardCacheWeakIdentityMap_Class);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC
 * @return true if this descriptor is configured with a table per tenant policy.
 */
public boolean hasTablePerMultitenantPolicy() {
  return hasMultitenantPolicy() && getMultitenantPolicy().isTablePerMultitenantPolicy();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Set the class of identity map to be used by this descriptor.
 * The default is the "FullIdentityMap".
 */
public void setIdentityMapClass(Class theIdentityMapClass) {
  getCachePolicy().setIdentityMapClass(theIdentityMapClass);
}
origin: stackoverflow.com

 import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.mappings.DatabaseMapping;
import org.eclipse.persistence.oxm.mappings.XMLDirectMapping;
import org.eclipse.persistence.oxm.mappings.nullpolicy.XMLNullRepresentationType;
import org.eclipse.persistence.sessions.*;

public class NullPolicySessionEventListener extends SessionEventAdapter {

  @Override
  public void preLogin(SessionEvent event) {
    Project project = event.getSession().getProject();
    for(ClassDescriptor descriptor : project.getOrderedDescriptors()) {
      for(DatabaseMapping mapping : descriptor.getMappings()) {
        if(mapping.isAbstractDirectMapping()) {
          XMLDirectMapping xmlDirectMapping = (XMLDirectMapping) mapping;
          xmlDirectMapping.getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
          xmlDirectMapping.getNullPolicy().setNullRepresentedByEmptyNode(true);
        }
      }
    }
   }

}
origin: com.sun.jersey/jersey-json

TreeObjectBuilder objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder();
final XPathNodeWrapper nodeWrapper = actualNodeWrapper;
org.eclipse.persistence.descriptors

Most used classes

  • ClassDescriptor
  • DescriptorEvent
  • InheritancePolicy
    Purpose: Allows customization of an object's inheritance. The primary supported inheritance model us
  • DescriptorEventManager
  • DescriptorQueryManager
    Purpose: The query manager allows for the database operations that EclipseLink performs to be custom
  • CachePolicy,
  • FetchGroupManager,
  • VersionLockingPolicy,
  • AttributeChangeTrackingPolicy,
  • ChangeTracker,
  • DeferredChangeDetectionPolicy,
  • ObjectChangeTrackingPolicy,
  • AllFieldsLockingPolicy,
  • CMPPolicy$KeyElementAccessor,
  • CMPPolicy,
  • CacheIndex,
  • ChangedFieldsLockingPolicy,
  • ClassExtractor,
  • DescriptorEventListener
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