private OType getFieldType(final ODocumentEntry entry) { OType type = entry.type; if (type == null) { final OProperty prop = entry.property; if (prop != null) type = prop.getType(); } if (type == null || OType.ANY == type) type = OType.getTypeByValue(entry.value); return type; }
private OType getFieldType(final ODocumentEntry entry) { OType type = entry.type; if (type == null) { final OProperty prop = entry.property; if (prop != null) type = prop.getType(); } if (type == null || OType.ANY == type) type = OType.getTypeByValue(entry.value); return type; }
protected OType getFieldType(final ODocumentEntry entry) { OType type = entry.type; if (type == null) { final OProperty prop = entry.property; if (prop != null) type = prop.getType(); } if (type == null || OType.ANY == type) type = OType.getTypeByValue(entry.value); return type; }
@Override public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContext iContext, Object ioResult, Object[] iParams) { if (ioResult == null) { return null; } final OType t = OType.getTypeByValue(ioResult); if (t != null) { return t.toString(); } return null; } }
protected OType getTypeFromValueEmbedded(final Object fieldValue) { OType type = OType.getTypeByValue(fieldValue); if (type == OType.LINK && fieldValue instanceof ODocument && !((ODocument) fieldValue).getIdentity().isValid()) type = OType.EMBEDDED; return type; }
private OType getTypeFromValueEmbedded(final Object fieldValue) { OType type = fieldValue instanceof OResult ? OType.EMBEDDED : OType.getTypeByValue(fieldValue); if (type == OType.LINK && fieldValue instanceof ODocument && !((ODocument) fieldValue).getIdentity().isValid()) type = OType.EMBEDDED; return type; }
private OType getTypeFromValueEmbedded(final Object fieldValue) { OType type = OType.getTypeByValue(fieldValue); if (type == OType.LINK && fieldValue instanceof ODocument && !((ODocument) fieldValue).getIdentity().isValid()) type = OType.EMBEDDED; return type; }
private OType getTypeFromValueEmbedded(final Object fieldValue) { OType type = OType.getTypeByValue(fieldValue); if (type == OType.LINK && fieldValue instanceof ODocument && !((ODocument) fieldValue).getIdentity().isValid()) type = OType.EMBEDDED; return type; }
valueType = OType.getTypeByValue(iValue);
OType t = fieldType; if (t == null) t = OType.getTypeByValue(iFieldValue); if (t == OType.LINKLIST) appendType(typesStack.peek(), iFieldName, 'z');
original = OType.getTypeByValue(value); if (iFieldType == original) return value;
@SuppressWarnings("unchecked") private void writeEmbeddedMap(BytesContainer bytes, Map<Object, Object> map) { Set fieldNames = map.keySet(); OVarIntSerializer.write(bytes, map.size()); for (Object f : fieldNames) { if (!(f instanceof String)) { throw new OSerializationException("Invalid key type for map: " + f + " (only Strings supported)"); } String field = (String) f; writeString(bytes, field); final Object value = map.get(field); if (value != null) { if (value instanceof OResult) { writeOType(bytes, bytes.alloc(1), OType.EMBEDDED); serializeValue(bytes, value, OType.EMBEDDED, null); } else { final OType type = OType.getTypeByValue(value); if (type == null) { throw new OSerializationException( "Impossible serialize value of type " + value.getClass() + " with the Result binary serializer"); } writeOType(bytes, bytes.alloc(1), type); serializeValue(bytes, value, type, null); } } else { writeOType(bytes, bytes.alloc(1), null); } } }
case EMBEDDED: Object value = doc.field(field); OType linkedType = OType.getTypeByValue(value); if(OType.EMBEDDED.equals(linkedType)) property.setLinkedClass(((ODocument)value).getSchemaClass()); else property.setLinkedType(linkedType); if(objectCollection!=null && !objectCollection.isEmpty()) { value = objectCollection.iterator().next(); property.setLinkedType(OType.getTypeByValue(value)); if(objectMap!=null && !objectMap.isEmpty()) { value = objectMap.values().iterator().next(); property.setLinkedType(OType.getTypeByValue(value));
if (iPropertyValue == null || fieldType != null || oldType != OType.getTypeByValue(iPropertyValue)) entry.type = fieldType;
if (iPropertyValue == null || fieldType != null || oldType != OType.getTypeByValue(iPropertyValue)) entry.type = fieldType;
iValue.field(prjName, projectionValue, OType.EMBEDDED); } else if (projectionValue instanceof Set<?>) { OType type = OType.getTypeByValue(projectionValue); if (type == OType.LINKSET && !entriesPersistent((Collection<OIdentifiable>) projectionValue)) type = OType.EMBEDDEDSET; iValue.field(prjName, projectionValue, type); } else if (projectionValue instanceof Map<?, ?>) { OType type = OType.getTypeByValue(projectionValue); if (type == OType.LINKMAP && !entriesPersistent(((Map<?, OIdentifiable>) projectionValue).values())) type = OType.EMBEDDEDMAP; iValue.field(prjName, projectionValue, type); } else if (projectionValue instanceof List<?>) { OType type = OType.getTypeByValue(projectionValue); if (type == OType.LINKLIST && !entriesPersistent((Collection<OIdentifiable>) projectionValue)) type = OType.EMBEDDEDLIST;
fieldType = OType.getTypeByValue(fieldValue);
final OType type = OType.getTypeByValue(value); if (type == null) { throw new OSerializationException( serializeValue(bytes, value, OType.EMBEDDED, null); } else { final OType type = OType.getTypeByValue(value); if (type == null) { throw new OSerializationException(
if (OType.LINKMAP.equals(OType.getTypeByValue(fieldValue)) && !(value instanceof OIdentifiable)) { map = new OTrackedMap(record, map, Object.class); record.field(entry.getKey(), map, OType.EMBEDDEDMAP);
final OType type = OType.getTypeByValue(r); final OType type = OType.getTypeByValue(l); if (ORecordSerializerBinary.INSTANCE.getCurrentSerializer().getComparator().isBinaryComparable(type)) { final BytesContainer bytes = new BytesContainer();