Refine search
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; }
/** * INTERNAL: * Validate the entire pre-initialization descriptor. */ protected void validateBeforeInitialization(AbstractSession session) { selfValidationBeforeInitialization(session); for (Enumeration mappings = getMappings().elements(); mappings.hasMoreElements();) { ((DatabaseMapping)mappings.nextElement()).validateBeforeInitialization(session); } }
ClassDescriptor descriptor = nodeValue.getMapping().getReferenceDescriptor(); descriptor = nodeValue.getMapping().getDescriptor(); TreeObjectBuilder objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder(); final XPathNodeWrapper nodeWrapper = actualNodeWrapper;
/** * INTERNAL: * It is responsible for initializing the policy; */ public void initialize(AbstractSession session) { // If the version field is not in the primary table, then they cannot be batched together. if (this.descriptor.getTables().size() > 0) { this.descriptor.setHasMultipleTableConstraintDependecy(true); } }
/** * INTERNAL: * Validate the entire post-initialization descriptor. */ protected void validateAfterInitialization(AbstractSession session) { selfValidationAfterInitialization(session); for (Enumeration mappings = getMappings().elements(); mappings.hasMoreElements();) { ((DatabaseMapping)mappings.nextElement()).validateAfterInitialization(session); } }
/** * INTERNAL: * Rehash any hashtables based on fields. * This is used to clone descriptors for aggregates, which hammer field names, * it is probably better not to hammer the field name and this should be refactored. */ public void rehashFieldDependancies(AbstractSession session) { getObjectBuilder().rehashFieldDependancies(session); for (Enumeration enumtr = getMappings().elements(); enumtr.hasMoreElements();) { ((DatabaseMapping)enumtr.nextElement()).rehashFieldDependancies(session); } }
public CommitOrderDependencyNode nodeFor(Class c) { for (Enumeration e = nodes.elements(); e.hasMoreElements();) { CommitOrderDependencyNode n = (CommitOrderDependencyNode)e.nextElement(); if (n.getDescriptor().getJavaClass() == c) { return n; } } return null; }
/** * Return the constraint ordered classes. */ public Vector getOrderedClasses() { Vector orderedClasses = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getOrderedDescriptors().size()); for (Enumeration orderedDescriptorsEnum = getOrderedDescriptors().elements(); orderedDescriptorsEnum.hasMoreElements();) { orderedClasses.addElement(((ClassDescriptor)orderedDescriptorsEnum.nextElement()).getJavaClass()); } return orderedClasses; }
/** * PUBLIC: * Return the table names. */ public Vector getTableNames() { Vector tableNames = new Vector(getTables().size()); for (Enumeration fieldsEnum = getTables().elements(); fieldsEnum.hasMoreElements();) { tableNames.addElement(((DatabaseTable)fieldsEnum.nextElement()).getQualifiedName()); } return tableNames; }
/** * INTERNAL: * Checks if the class has any private owned parts are not */ public boolean hasPrivatelyOwnedParts() { for (Enumeration mappings = getMappings().elements(); mappings.hasMoreElements();) { DatabaseMapping mapping = (DatabaseMapping)mappings.nextElement(); if (mapping.isPrivateOwned()) { return true; } } return false; }
/** * PUBLIC: Set the table Qualifier for this descriptor. This table creator will be used for * all tables in this descriptor */ public void setTableQualifier(String tableQualifier) { for (Enumeration enumtr = getTables().elements(); enumtr.hasMoreElements();) { DatabaseTable table = (DatabaseTable)enumtr.nextElement(); table.setTableQualifier(tableQualifier); } }
public void writeOutMappings(XMLRecord row, Object object, AbstractSession session) { Vector mappings = getDescriptor().getMappings(); for (int index = 0; index < mappings.size(); index++) { DatabaseMapping mapping = (DatabaseMapping)mappings.get(index); mapping.writeFromObjectIntoRow(object, row, session); } } public void addNamespaceDeclarations(Document document) {
/** * INTERNAL: * Extract the reference pk for rvh usage in remote model. */ public Vector extractPrimaryKeysFromRealReferenceObject(Object object, AbstractSession session) { if (object == null) { return new Vector(1); } else { Object implementation = getReferenceDescriptor().getObjectBuilder().unwrapObject(object, session); return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(implementation, session); } }
@Override public Class<?> getPropertyType(int propertyIndex) { return getDescriptor().getMappings().get(propertyIndex).getAttributeClassification(); }
protected DatabaseMapping getMappingOfFirstPrimaryKey(ClassDescriptor descriptor) { if (descriptor != null) { for (Iterator i = descriptor.getMappings().iterator(); i.hasNext(); ) { DatabaseMapping m = (DatabaseMapping)i.next(); if (m.isPrimaryKeyMapping()) { return m; } } } return null; }
public NestedTable(QueryKeyExpression queryKeyExpression) { super(); this.queryKeyExpression = queryKeyExpression; setName((queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getName()); tableQualifier = (queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getQualifiedName(); }
/** * PUBLIC: * Returns the reference table. */ public DatabaseTable getReferenceTable(ClassDescriptor desc) { // TODO: This won't work for direct collection. // Should extract the target table from joinCriteria (if it's not null), // like ManyToManyQueryKey.getRelationTable does. return desc.getTables().firstElement(); }