public OTriple(final K iKey, final V iValue, final SV iSubValue) { init(iKey, iValue, iSubValue); }
Object fieldValue = record.field(entry.getKey()); final OProperty property = ODocumentInternal.getImmutableSchemaClass(record).getProperty(entry.getKey()); if (property != null && (property.getType() != null && (!property.getType().equals(OType.EMBEDDEDMAP) && !property .getType().equals(OType.LINKMAP)))) { throw new OCommandExecutionException("field " + entry.getKey() + " is not defined as a map"); record.field(entry.getKey(), fieldValue); Map<String, Object> map = (Map<String, Object>) fieldValue; OPair<String, Object> pair = entry.getValue(); final OProperty property = record.getSchemaClass().getProperty(entry.getKey()); if (property != null && property.getType().equals(OType.LINKMAP) && !(value instanceof OIdentifiable)) { throw new OCommandExecutionException("field " + entry.getKey() + " defined of type LINKMAP accept only link values"); record.field(entry.getKey(), map, OType.EMBEDDEDMAP);
final OPair<Direction, String> connection = getConnection(iDirection, fieldName, iClassNames); if (connection != null) result.add(new OTriple<String, Direction, String>(fieldName, connection.getKey(), connection.getValue())); switch (iDirection) { case OUT: result.add(new OTriple<String, Direction, String>(CONNECTION_OUT_PREFIX + className, Direction.OUT, className)); break; case IN: result.add(new OTriple<String, Direction, String>(CONNECTION_IN_PREFIX + className, Direction.IN, className)); break; case BOTH: result.add(new OTriple<String, Direction, String>(CONNECTION_OUT_PREFIX + className, Direction.OUT, className)); result.add(new OTriple<String, Direction, String>(CONNECTION_IN_PREFIX + className, Direction.IN, className)); break; result.add(new OTriple<String, Direction, String>(OrientBaseGraph.CONNECTION_OUT, Direction.OUT, null)); else if (iDirection == Direction.IN) result.add(new OTriple<String, Direction, String>(OrientBaseGraph.CONNECTION_IN, Direction.IN, null)); else { result.add(new OTriple<String, Direction, String>(OrientBaseGraph.CONNECTION_OUT, Direction.OUT, null)); result.add(new OTriple<String, Direction, String>(OrientBaseGraph.CONNECTION_IN, Direction.IN, null)); int i = 0; for (OTriple<String, Direction, String> connectionField : result) fieldNames[i++] = connectionField.getKey(); doc.deserializeFields(fieldNames);
private void parsePutFields() { String fieldName; String fieldKey; String fieldValue; boolean firstLap = true; while (!parserIsEnded() && (firstLap || parserGetLastSeparator() == ',' || parserGetCurrentChar() == ',') && !parserGetLastWord().equals(KEYWORD_WHERE)) { fieldName = parserRequiredWord(false, "Field name expected"); parserRequiredKeyword("="); fieldKey = parserRequiredWord(false, "Key expected"); fieldValue = getBlock(parserRequiredWord(false, "Value expected", " =><,\r\n")); // INSERT TRANSFORMED FIELD VALUE putEntries.add( new OTriple(fieldName, (String) getFieldValueCountingParameters(fieldKey), getFieldValueCountingParameters(fieldValue))); parserSkipWhiteSpaces(); firstLap = false; } if (putEntries.size() == 0) throwSyntaxErrorException("Entries to put <field> = <key>, <value> are missed. Example: name = 'Bill', 30"); }
public OTriple(final K iKey, final V iValue, final SV iSubValue) { init(iKey, iValue, iSubValue); }