congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EISCompositeObjectMapping
Code IndexAdd Tabnine to your IDE (free)

How to use
EISCompositeObjectMapping
in
org.eclipse.persistence.eis.mappings

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

origin: com.haulmont.thirdparty/eclipselink

@Override
protected Object buildCompositeRow(Object attributeValue, AbstractSession session, AbstractRecord record, WriteType writeType) {
  if (((EISDescriptor)getDescriptor()).isXMLFormat()) {
    XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
    return objectBuilder.buildRow(attributeValue, session, getField(), (XMLRecord)record);
  } else {
    AbstractRecord nestedRow = this.getObjectBuilder(attributeValue, session).buildRow(attributeValue, session, writeType);
    return this.getReferenceDescriptor(attributeValue, session).buildFieldValueFromNestedRow(nestedRow, session);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Set the Mapping field name attribute to the given XPath String
 *
 * @param xpathString String
 *
 */
public void setXPath(String xpathString) {
  this.setField(new XMLField(xpathString));
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Return a new aggregate/embedded mapping for this type of descriptor.
 */
@Override
public AggregateMapping newAggregateMapping() {
  return new EISCompositeObjectMapping();
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Build the value for the database field and put it in the
 * specified database row.
 */
@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session, WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue = this.getAttributeValueFromObject(object);
  // handle "." xpath - condition: xml data format AND xml field is "self"
  if ((((EISDescriptor)getDescriptor()).isXMLFormat()) && ((XMLField)getField()).isSelfField()) {
    XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
    objectBuilder.buildIntoNestedRow(record, attributeValue, session);
  } else {
    Object fieldValue = null;
    if (attributeValue != null) {
      fieldValue = buildCompositeRow(attributeValue, session, record, writeType);
    }
    record.put(this.getField(), fieldValue);
  }
}
 
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Initialize the mapping.
 */
@Override
public void postInitialize(AbstractSession session) throws DescriptorException {
  super.postInitialize(session);
  if (getReferenceDescriptor() != null) {
    getReferenceDescriptor().getCachePolicy().setCacheIsolation(this.descriptor.getCachePolicy().getCacheIsolation());
    // Changed as part of fix for bug#4410581 aggregate mapping can not be set to use change tracking if owning descriptor does not use it.
    // Basically the policies should be the same, but we also allow deferred with attribute for CMP2 (courser grained).
    if (getDescriptor().getObjectChangePolicy().getClass().equals(DeferredChangeDetectionPolicy.class)) {
      getReferenceDescriptor().setObjectChangePolicy(new DeferredChangeDetectionPolicy());
    } else if (getDescriptor().getObjectChangePolicy().getClass().equals(ObjectChangeTrackingPolicy.class)
        && getReferenceDescriptor().getObjectChangePolicy().getClass().equals(AttributeChangeTrackingPolicy.class)) {
      getReferenceDescriptor().setObjectChangePolicy(new ObjectChangeTrackingPolicy());
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * PUBLIC:
 * Return the name of the field mapped by the mapping.
 */
public String getFieldName() {
  return this.getField().getName();
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected Object buildCompositeObject(ObjectBuilder objectBuilder, AbstractRecord nestedRow, ObjectBuildingQuery query, JoinedAttributeManager joinManager) {
  if (((EISDescriptor)getDescriptor()).getDataFormat() == EISDescriptor.XML) {
    return objectBuilder.buildObject(query, nestedRow, joinManager);
  } else {
    Object aggregateObject = objectBuilder.buildNewInstance();
    objectBuilder.buildAttributesIntoObject(aggregateObject, nestedRow, query, joinManager, false);
    return aggregateObject;
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * INTERNAL:
   * Build the value for the database field and put it in the
   * specified database row.
   */
  public void writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session) throws DescriptorException {
    if (this.isReadOnly()) {
      return;
    }

    Object attributeValue = this.getAttributeValueFromObject(object);

    // handle "." xpath - condition: xml data format AND xml field is "self"
    if ((((EISDescriptor)getDescriptor()).getDataFormat() == EISDescriptor.XML) && ((XMLField)getField()).isSelfField()) {
      XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
      objectBuilder.buildIntoNestedRow(record, attributeValue, session);
    } else {
      Object fieldValue = null;

      if (attributeValue != null) {
        fieldValue = buildCompositeRow(attributeValue, session, record);
      }

      record.put(this.getField(), fieldValue);
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Initialize the mapping.
 */
@Override
public void postInitialize(AbstractSession session) throws DescriptorException {
  super.postInitialize(session);
  if (getReferenceDescriptor() != null) {
    getReferenceDescriptor().getCachePolicy().setCacheIsolation(this.descriptor.getCachePolicy().getCacheIsolation());
    // Changed as part of fix for bug#4410581 aggregate mapping can not be set to use change tracking if owning descriptor does not use it.
    // Basically the policies should be the same, but we also allow deferred with attribute for CMP2 (courser grained).
    if (getDescriptor().getObjectChangePolicy().getClass().equals(DeferredChangeDetectionPolicy.class)) {
      getReferenceDescriptor().setObjectChangePolicy(new DeferredChangeDetectionPolicy());
    } else if (getDescriptor().getObjectChangePolicy().getClass().equals(ObjectChangeTrackingPolicy.class)
        && getReferenceDescriptor().getObjectChangePolicy().getClass().equals(AttributeChangeTrackingPolicy.class)) {
      getReferenceDescriptor().setObjectChangePolicy(new ObjectChangeTrackingPolicy());
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * PUBLIC:
 * Return the name of the field mapped by the mapping.
 */
public String getFieldName() {
  return this.getField().getName();
}
origin: com.haulmont.thirdparty/eclipselink

protected Object buildCompositeObject(ObjectBuilder objectBuilder, AbstractRecord nestedRow, ObjectBuildingQuery query, CacheKey parentCacheKey, JoinedAttributeManager joinManager, AbstractSession targetSession) {
  if (((EISDescriptor)getDescriptor()).isXMLFormat()) {
    return objectBuilder.buildObject(query, nestedRow, joinManager);
  } else {
    Object aggregateObject = objectBuilder.buildNewInstance();
    objectBuilder.buildAttributesIntoObject(aggregateObject, parentCacheKey, nestedRow, query, joinManager, query.getExecutionFetchGroup(objectBuilder.getDescriptor()), false, targetSession);
    return aggregateObject;
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Build the value for the database field and put it in the
 * specified database row.
 */
@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session, WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue = this.getAttributeValueFromObject(object);
  // handle "." xpath - condition: xml data format AND xml field is "self"
  if ((((EISDescriptor)getDescriptor()).isXMLFormat()) && ((XMLField)getField()).isSelfField()) {
    XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
    objectBuilder.buildIntoNestedRow(record, attributeValue, session);
  } else {
    Object fieldValue = null;
    if (attributeValue != null) {
      fieldValue = buildCompositeRow(attributeValue, session, record, writeType);
    }
    record.put(this.getField(), fieldValue);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected Object buildCompositeRow(Object attributeValue, AbstractSession session, AbstractRecord record, WriteType writeType) {
  if (((EISDescriptor)getDescriptor()).isXMLFormat()) {
    XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
    return objectBuilder.buildRow(attributeValue, session, getField(), (XMLRecord)record);
  } else {
    AbstractRecord nestedRow = this.getObjectBuilder(attributeValue, session).buildRow(attributeValue, session, writeType);
    return this.getReferenceDescriptor(attributeValue, session).buildFieldValueFromNestedRow(nestedRow, session);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Set the Mapping field name attribute to the given XPath String
 *
 * @param xpathString String
 *
 */
public void setXPath(String xpathString) {
  this.setField(new XMLField(xpathString));
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Return the name of the field mapped by the mapping.
 */
public String getFieldName() {
  return this.getField().getName();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

protected Object buildCompositeObject(ObjectBuilder objectBuilder, AbstractRecord nestedRow, ObjectBuildingQuery query, CacheKey parentCacheKey, JoinedAttributeManager joinManager, AbstractSession targetSession) {
  if (((EISDescriptor)getDescriptor()).isXMLFormat()) {
    return objectBuilder.buildObject(query, nestedRow, joinManager);
  } else {
    Object aggregateObject = objectBuilder.buildNewInstance();
    objectBuilder.buildAttributesIntoObject(aggregateObject, parentCacheKey, nestedRow, query, joinManager, query.getExecutionFetchGroup(objectBuilder.getDescriptor()), false, targetSession);
    return aggregateObject;
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Return a new aggregate/embedded mapping for this type of descriptor.
 */
@Override
public AggregateMapping newAggregateMapping() {
  return new EISCompositeObjectMapping();
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected Object buildCompositeRow(Object attributeValue, AbstractSession session, AbstractRecord record) {
  if (((EISDescriptor)getDescriptor()).getDataFormat() == EISDescriptor.XML) {
    XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder();
    return objectBuilder.buildRow(attributeValue, session, getField(), (XMLRecord)record);
  } else {
    AbstractRecord nestedRow = this.getObjectBuilder(attributeValue, session).buildRow(attributeValue, session);
    return this.getReferenceDescriptor(attributeValue, session).buildFieldValueFromNestedRow(nestedRow, session);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Set the Mapping field name attribute to the given XPath String
 *
 * @param xpathString String
 *
 */
public void setXPath(String xpathString) {
  this.setField(new XMLField(xpathString));
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Get the XPath String
 *
 * @return String the XPath String associated with this Mapping
 *
 */
public String getXPath() {
  return getField().getName();
}
org.eclipse.persistence.eis.mappingsEISCompositeObjectMapping

Javadoc

EIS Composite Object Mappings map a Java object to a privately owned, one-to-one relationship to an EIS Record according to its descriptor's record type.

Record Type Description
Indexed Ordered collection of record elements. The indexed record EIS format enables Java class attribute values to be retreived by position or index.
Mapped Key-value map based representation of record elements. The mapped record EIS format enables Java class attribute values to be retreived by an object key.
XML Record/Map representation of an XML DOM element.

Most used methods

  • buildCompositeRow
  • getAttributeValueFromObject
  • getDescriptor
  • getField
  • getObjectBuilder
  • getReferenceDescriptor
  • isReadOnly
  • setField
  • <init>

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • putExtra (Intent)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JTable (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Vim plugins
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