protected static int writeNullLink(final BytesContainer bytes) { final int pos = OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterId()); OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterPosition()); return pos; }
private int writeNullLink(final BytesContainer bytes) { final int pos = OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterId()); OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterPosition()); return pos; }
private int writeNullLink(final BytesContainer bytes) { final int pos = OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterId()); OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterPosition()); return pos; }
private int writeNullLink(final BytesContainer bytes) { final int pos = OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterId()); OVarIntSerializer.write(bytes, NULL_RECORD_ID.getIdentity().getClusterPosition()); return pos; }
SourceRepository sourceRepository = repositoryFactory.produceRepository(OrientDbSourceRepository.class); if (sourceRepository != null) sourceReference.setSource(sourceRepository.find(source.getIdentity().toString())); else logger.warn("Could not produce class OrientDbSourceRepository while converting to entity.");
initDb(); period.setParentId(parent.getIdentity().toString()); period.setParentModel(db.getMetadata().getSchema().getClassByClusterId(parent.getClusterId()).getName());
RelationTypeRepository relationTypeRepository = repositoryFactory.produceRepository(OrientDbRelationTypeRepository.class); if (relationTypeRepository != null) relation.setRelationType(relationTypeRepository.find(relationType.getIdentity().toString())); else logger.error("Could not produce RelationTypeRepository while converting relation.");
@Override public ILocation convertToEntity(ODocument document) { Location location = new Location(); location.setLongitude(document.field("longitude", Double.class)); location.setLatitude(document.field("latitude", Double.class)); location.setComment(document.field("comment", String.class)); // populate with data populateEntityWithBaseData(document, location); populateEntityWithCreatedModified(document, location); // parent ORecordId parent = document.field("parent", ORecordId.class); if (parent != null) { initDb(); location.setParentId(parent.getIdentity().toString()); location.setParentModel(db.getMetadata().getSchema().getClassByClusterId(parent.getClusterId()).getName()); //TODO: lazy load parent } // add distance, if set in document (added by some query results) if (document.field("$distance") != null) location.setDistance(document.field("$distance", Double.class)); return location; }