protected List deserializeEmbeddedCollectionAsCollectionOfBytes(final BytesContainer bytes, int serializerVersion) { List retVal = new ArrayList(); List<RecordInfo> fieldsInfo = getPositionsFromEmbeddedCollection(bytes, serializerVersion); for (RecordInfo fieldInfo : fieldsInfo) { if (fieldInfo.fieldType.isEmbedded()) { OResultBinary result = new OResultBinary(bytes.bytes, fieldInfo.fieldStartOffset, fieldInfo.fieldLength, serializerVersion); retVal.add(result); } else { int currentOffset = bytes.offset; bytes.offset = fieldInfo.fieldStartOffset; Object value = deserializeValue(bytes, fieldInfo.fieldType, null); retVal.add(value); bytes.offset = currentOffset; } } return retVal; }
private void updateFieldToStore(OIndexDefinition indexDefinition) { List<String> fields = indexDefinition.getFields(); for (String field : fields) { OProperty property = indexClass.getProperty(field); if (property.getType().isEmbedded() && property.getLinkedType() != null) { fieldsToStore.put(field, true); } else { fieldsToStore.put(field, false); } } }
protected Map<String, Object> deserializeEmbeddedMapAsMapOfBytes(final BytesContainer bytes, int serializerVersion) { Map<String, Object> retVal = new TreeMap<>(); List<MapRecordInfo> positionsWithLengths = getPositionsFromEmbeddedMap(bytes, serializerVersion); for (MapRecordInfo recordInfo : positionsWithLengths) { String key = recordInfo.key; Object value; if (recordInfo.fieldType.isEmbedded()) { value = new OResultBinary(bytes.bytes, recordInfo.fieldStartOffset, recordInfo.fieldLength, serializerVersion); } else { int currentOffset = bytes.offset; bytes.offset = recordInfo.fieldStartOffset; value = deserializeValue(bytes, recordInfo.fieldType, null); bytes.offset = currentOffset; } retVal.put(key, value); } return retVal; }
public Array getArray(String columnLabel) throws SQLException { OType columnType = result.toElement().getSchemaType().map(t -> t.getProperty(columnLabel).getType()).orElse(OType.EMBEDDEDLIST); assert columnType.isEmbedded() && columnType.isMultiValue(); // System.out.println("columnType.name() = " + columnType.getDefaultJavaType()); Array array = new OrientJdbcArray(result.getProperty(columnLabel)); lastReadWasNull = array == null; return array; }
private void checkCollectionIndex(OIndexDefinition indexDefinition) { List<String> fields = indexDefinition.getFields(); OClass aClass = getDatabase().getMetadata().getSchema().getClass(indexDefinition.getClassName()); for (String field : fields) { OProperty property = aClass.getProperty(field); if (property.getType().isEmbedded() && property.getLinkedType() != null) { collectionFields.put(field, true); } else { collectionFields.put(field, false); } } }
private void checkCollectionIndex(OIndexDefinition indexDefinition) { List<String> fields = indexDefinition.getFields(); OClass aClass = getDatabase().getMetadata().getSchema().getClass(indexDefinition.getClassName()); for (String field : fields) { OProperty property = aClass.getProperty(field); if (property.getType().isEmbedded() && property.getLinkedType() != null) { collectionFields.put(field, true); } else { collectionFields.put(field, false); } } }
@Override protected void onConfigure() { super.onConfigure(); String critery = getPropertyObject(); if(OPropertyPrototyper.TYPE.equals(critery)) { OType oType = (OType)getEnteredValue(); // Show Linked Class if type is a some kind of link AbstractMetaPanel<OProperty, String, ?> metaPanel = getMetaComponent(OPropertyPrototyper.LINKED_CLASS); if(metaPanel!=null) metaPanel.setVisibilityAllowed(oType!=null && (oType.isLink() || oType.isEmbedded())); // Show Linked Type if type is a some kind of embedded metaPanel = getMetaComponent(OPropertyPrototyper.LINKED_TYPE); if(metaPanel!=null) metaPanel.setVisibilityAllowed(oType!=null && oType.isEmbedded() && !OType.EMBEDDED.equals(oType)); // Show inverse if current type is a link metaPanel = getMetaComponent(CustomAttribute.PROP_INVERSE.getName()); if(metaPanel!=null) metaPanel.setVisibilityAllowed(oType!=null && oType.isLink()); } else if(CustomAttribute.CALCULABLE.getName().equals(critery)) { Boolean calculable = (Boolean) getEnteredValue(); AbstractMetaPanel<OProperty, String, ?> metaPanel = getMetaComponent(CustomAttribute.CALC_SCRIPT.getName()); if(metaPanel!=null) metaPanel.setVisibilityAllowed(calculable!=null && calculable); } }
if (type.isEmbedded()) { fieldDataLength = getEmbeddedFieldSize(bytes, valuePos, serializerVersion, type); if (type.isEmbedded()) { fieldDataLength = getEmbeddedFieldSize(bytes, valuePos, serializerVersion, type);