Tabnine Logo
InterfacePolicy
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.haulmont.thirdparty/eclipselink

/**
 * PUBLIC:
 * Returns the InterfacePolicy.
 * The interface policy allows for a descriptor's public and variable interfaces to be defined.
 * Caution must be used in using this method as it lazy initializes an interface policy.
 * Calling this on a descriptor that does not use interfaces will cause problems, #hasInterfacePolicy() must always first be called.
 */
public InterfacePolicy getInterfacePolicy() {
  if (interfacePolicy == null) {
    // Lazy initialize to conserve space in non-inherited classes.
    setInterfacePolicy(new InterfacePolicy(this));
  }
  return interfacePolicy;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Add child descriptor to the parent descriptor.
 */
public void addChildDescriptor(ClassDescriptor childDescriptor) {
  getChildDescriptors().add(childDescriptor);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Add parent descriptor.
 */
public void addParentDescriptor(ClassDescriptor parentDescriptor) {
  getParentDescriptors().add(parentDescriptor);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Select one object of any concrete subclass.
 */
public Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query) throws DatabaseException, QueryException {
  Object object = null;
  for (Enumeration childDescriptors = getChildDescriptors().elements(); childDescriptors.hasMoreElements() && (object == null);) {
    ClassDescriptor descriptor = (ClassDescriptor)childDescriptors.nextElement();
    object = descriptor.getInterfacePolicy().selectOneObject(query);
  }
  return object;
}
origin: com.haulmont.thirdparty/eclipselink

protected void addInterfaceLines(NonreflectiveMethodDefinition method, InterfacePolicy policy) {
  method.addLine("// Interface Properties.");
  if (policy.isInterfaceChildDescriptor()) {
    for (Iterator<String> interfacesEnum = policy.getParentInterfaceNames().iterator();
         interfacesEnum.hasNext();) {
      String parentInterfaceName = interfacesEnum.next();
      method.addLine("descriptor.getInterfacePolicy().addParentInterface(" + parentInterfaceName + ".class);");
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Allow the descriptor to initialize any dependencies on this session.
 */
public void preInterfaceInitialization(AbstractSession session) throws DescriptorException {
  if (isInterfaceInitialized(PREINITIALIZED)) {
    return;
  }
  setInterfaceInitializationStage(PREINITIALIZED);
  assignDefaultValues(session);
  if (isInterfaceChildDescriptor()) {
    for (Iterator<Class> interfaces = getInterfacePolicy().getParentInterfaces().iterator();
         interfaces.hasNext();) {
      Class parentInterface = interfaces.next();
      ClassDescriptor parentDescriptor = session.getDescriptor(parentInterface);
      if ((parentDescriptor == null) || (parentDescriptor.getJavaClass() == getJavaClass()) || parentDescriptor.getInterfacePolicy().usesImplementorDescriptor()) {
        session.getProject().getDescriptors().put(parentInterface, this);
        session.clearLastDescriptorAccessed();
      } else if (!parentDescriptor.isDescriptorForInterface()) {
        throw DescriptorException.descriptorForInterfaceIsMissing(parentInterface.getName());
      } else {
        parentDescriptor.preInterfaceInitialization(session);
        parentDescriptor.getInterfacePolicy().addChildDescriptor(this);
        getInterfacePolicy().addParentDescriptor(parentDescriptor);
      }
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  for (Iterator<Class> interfaces = getInterfacePolicy().getParentInterfaces().iterator();
       interfaces.hasNext();) {
    Class parentInterface = interfaces.next();
getInterfacePolicy().initialize(session);
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * This figures out the best name for each descriptor,
 * first using the local class name then the qualified one for duplicates.
 */
protected void computeDescriptorMethodNames() {
  Hashtable shortNames = new Hashtable();
  Iterator descriptors = project.getOrderedDescriptors().iterator();
  while (descriptors.hasNext()) {
    ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
    // Singleton interface descriptors should not exist.
    if (!(descriptor.isDescriptorForInterface() && (descriptor.getInterfacePolicy().getImplementorDescriptor() != null))) {
      String shortName = Helper.getShortClassName(descriptor.getJavaClassName());
      if (shortNames.containsKey(shortName)) {
        // Use the full package name.
        ClassDescriptor firstDescriptor = (ClassDescriptor)shortNames.get(shortName);
        getDescriptorMethodNames().put(firstDescriptor, removeDots(firstDescriptor.getJavaClassName()));
        getDescriptorMethodNames().put(descriptor, removeDots(descriptor.getJavaClassName()));
      } else {
        shortNames.put(shortName, descriptor);
        getDescriptorMethodNames().put(descriptor, shortName);
      }
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Select all objects for an interface descriptor.
 * This is accomplished by selecting for all of the concrete classes and then merging the objects.
 *
 * @return Vector containing all objects.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Object selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query) throws DatabaseException {
  org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy = query.getContainerPolicy();
  Object objects = containerPolicy.containerInstance(1);
  for (Enumeration childDescriptors = getChildDescriptors().elements(); childDescriptors.hasMoreElements();) {
    ClassDescriptor descriptor = (ClassDescriptor)childDescriptors.nextElement();
    objects = containerPolicy.concatenateContainers(objects, descriptor.getInterfacePolicy().selectAllObjects(query));
  }
  return objects;
}
 
origin: com.haulmont.thirdparty/eclipselink

public void addParentInterfaceName(String parentInterfaceName) {
  getParentInterfaceNames().add(parentInterfaceName);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * PUBLIC:
 * Add the parent Interface class.
 *
 * This method should be called once for each parent Interface of the Descriptor.
 */
public void addParentInterface(Class parentInterface) {
  getParentInterfaces().addElement(parentInterface);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

this.interfacePolicy.convertClassNamesToClasses(classLoader);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Allow the descriptor to initialize any dependencies on this session.
 */
public void preInterfaceInitialization(AbstractSession session) throws DescriptorException {
  if (isInterfaceInitialized(PREINITIALIZED)) {
    return;
  }
  setInterfaceInitializationStage(PREINITIALIZED);
  assignDefaultValues(session);
  
  if (isInterfaceChildDescriptor()) {
    for (Enumeration interfaces = getInterfacePolicy().getParentInterfaces().elements();
         interfaces.hasMoreElements();) {
      Class parentInterface = (Class)interfaces.nextElement();
      ClassDescriptor parentDescriptor = session.getDescriptor(parentInterface);
      if ((parentDescriptor == null) || (parentDescriptor.getJavaClass() == getJavaClass()) || parentDescriptor.getInterfacePolicy().usesImplementorDescriptor()) {
        session.getProject().getDescriptors().put(parentInterface, this);
        session.clearLastDescriptorAccessed();
      } else if (!parentDescriptor.isDescriptorForInterface()) {
        throw DescriptorException.descriptorForInterfaceIsMissing(parentInterface.getName());
      } else {
        parentDescriptor.preInterfaceInitialization(session);
        parentDescriptor.getInterfacePolicy().addChildDescriptor(this);
        getInterfacePolicy().addParentDescriptor(parentDescriptor);
      }
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

protected void addInterfaceLines(NonreflectiveMethodDefinition method, InterfacePolicy policy) {
  method.addLine("// Interface Properties.");
  if (policy.isInterfaceChildDescriptor()) {
    for (Iterator<String> interfacesEnum = policy.getParentInterfaceNames().iterator();
         interfacesEnum.hasNext();) {
      String parentInterfaceName = interfacesEnum.next();
      method.addLine("descriptor.getInterfacePolicy().addParentInterface(" + parentInterfaceName + ".class);");
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

  for (Iterator<Class> interfaces = getInterfacePolicy().getParentInterfaces().iterator();
       interfaces.hasNext();) {
    Class parentInterface = interfaces.next();
getInterfacePolicy().initialize(session);
origin: com.haulmont.thirdparty/eclipselink

/**
 * This figures out the best name for each descriptor,
 * first using the local class name then the qualified one for duplicates.
 */
protected void computeDescriptorMethodNames() {
  Hashtable shortNames = new Hashtable();
  Iterator descriptors = project.getOrderedDescriptors().iterator();
  while (descriptors.hasNext()) {
    ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
    // Singleton interface descriptors should not exist.
    if (!(descriptor.isDescriptorForInterface() && (descriptor.getInterfacePolicy().getImplementorDescriptor() != null))) {
      String shortName = Helper.getShortClassName(descriptor.getJavaClassName());
      if (shortNames.containsKey(shortName)) {
        // Use the full package name.
        ClassDescriptor firstDescriptor = (ClassDescriptor)shortNames.get(shortName);
        getDescriptorMethodNames().put(firstDescriptor, removeDots(firstDescriptor.getJavaClassName()));
        getDescriptorMethodNames().put(descriptor, removeDots(descriptor.getJavaClassName()));
      } else {
        shortNames.put(shortName, descriptor);
        getDescriptorMethodNames().put(descriptor, shortName);
      }
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public void addParentInterfaceName(String parentInterfaceName) {
  getParentInterfaceNames().addElement(parentInterfaceName);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Add the parent Interface class.
 *
 * This method should be called once for each parent Interface of the Descriptor.
 */
public void addParentInterface(Class parentInterface) {
  getParentInterfaces().add(parentInterface);
}
origin: com.haulmont.thirdparty/eclipselink

this.interfacePolicy.convertClassNamesToClasses(classLoader);
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Allow the descriptor to initialize any dependencies on this session.
 */
public void preInterfaceInitialization(AbstractSession session) throws DescriptorException {
  if (isInterfaceInitialized(PREINITIALIZED)) {
    return;
  }
  setInterfaceInitializationStage(PREINITIALIZED);
  assignDefaultValues(session);
  
  if (isInterfaceChildDescriptor()) {
    for (Iterator<Class> interfaces = getInterfacePolicy().getParentInterfaces().iterator();
         interfaces.hasNext();) {
      Class parentInterface = interfaces.next();
      ClassDescriptor parentDescriptor = session.getDescriptor(parentInterface);
      if ((parentDescriptor == null) || (parentDescriptor.getJavaClass() == getJavaClass()) || parentDescriptor.getInterfacePolicy().usesImplementorDescriptor()) {
        session.getProject().getDescriptors().put(parentInterface, this);
        session.clearLastDescriptorAccessed();
      } else if (!parentDescriptor.isDescriptorForInterface()) {
        throw DescriptorException.descriptorForInterfaceIsMissing(parentInterface.getName());
      } else {
        parentDescriptor.preInterfaceInitialization(session);
        parentDescriptor.getInterfacePolicy().addChildDescriptor(this);
        getInterfacePolicy().addParentDescriptor(parentDescriptor);
      }
    }
  }
}
org.eclipse.persistence.descriptorsInterfacePolicy

Javadoc

Purpose: Allows for a descriptor's implemented interfaces to be configured. Generally Interface Descriptors are used for 1 of 2 reasons:

a. Interface descriptors can be used to query across a set of classes that do not share a table.
b. As a target of a variable one to one mapping.

Most used methods

  • <init>
    INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.
  • addChildDescriptor
    INTERNAL: Add child descriptor to the parent descriptor.
  • addParentDescriptor
    INTERNAL: Add parent descriptor.
  • convertClassNamesToClasses
    INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based
  • getChildDescriptors
    INTERNAL: Return all the child descriptors.
  • getImplementorDescriptor
    INTERNAL: Returns the implementor descriptor class.
  • getParentDescriptors
    INTERNAL: Return all the parent descriptors.
  • getParentInterfaceNames
  • getParentInterfaces
    INTERNAL: Return the vector of parent interfaces.
  • initialize
    INTERNAL: Set the vector to store parent interfaces.
  • isInterfaceChildDescriptor
    INTERNAL: Check if it is a child descriptor.
  • isTablePerClassPolicy
    INTERNAL:
  • isInterfaceChildDescriptor,
  • isTablePerClassPolicy,
  • selectAllObjects,
  • selectAllObjectsUsingMultipleTableSubclassRead,
  • selectOneObject,
  • selectOneObjectUsingMultipleTableSubclassRead,
  • setDescriptor,
  • usesImplementorDescriptor,
  • prepareQuery,
  • addParentInterfaceName

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now