@Override public OCollate getCollate() { return delegate.getCollate(); }
protected OCollate getCollateForField(final OClass iClass, final String iFieldName) { if (iClass != null) { final OProperty p = iClass.getProperty(iFieldName); if (p != null) return p.getCollate(); } return null; }
public boolean isCaseSensitive(final int column) throws SQLException { final OProperty p = getProperty(column); return p != null ? p.getCollate().getName().equalsIgnoreCase("ci") : false; }
public OCollate getCollate(OResult currentRecord, OCommandContext ctx) { if (identifier != null && currentRecord != null) { return currentRecord.getRecord().map(x -> (OElement) x).flatMap(elem -> elem.getSchemaType()) .map(clazz -> clazz.getProperty(identifier.getStringValue())).map(prop -> prop.getCollate()).orElse(null); } return null; }
@SuppressWarnings("unchecked") @Override protected V getValue(OProperty entity, String critery) { CustomAttribute custom; if(OPropertyPrototyper.COLLATE.equals(critery)) { OCollate collate = entity.getCollate(); return (V)(collate!=null?collate.getName():null); } else if((custom = CustomAttribute.getIfExists(critery))!=null) { return custom.getValue(entity); } else { return (V) PropertyResolver.getValue(critery, entity); } }
@Override public void afterRegistration(final ODatabaseObject db, final SchemeDescriptor descriptor, final Field field, final CaseInsensitive annotation) { final String name = field.getName(); final boolean ci = annotation.value(); final String collate = ci ? OCaseInsensitiveCollate.NAME : ODefaultCollate.NAME; final OProperty property = db.getMetadata().getSchema() .getClass(descriptor.schemeClass).getProperty(name); if (!property.getCollate().getName().equals(collate)) { property.setCollate(collate); logger.debug("Set {}.{} property case insensitive={}", descriptor.schemeClass, name, ci); } } }
private Triple<Signal, OBinaryField, Integer> processPropertyDeserializeField(int len, final OImmutableSchema _schema, final String iFieldName, final OClass iClass, final BytesContainer bytes, int cumulativeLength, int headerStart, int headerLength) { final int id = (len * -1) - 1; final OGlobalProperty prop = _schema.getGlobalPropertyById(id); final int fieldLength = OVarIntSerializer.readAsInteger(bytes); final OType type; type = getPropertyTypeFromStream(prop, bytes); if (!iFieldName.equals(prop.getName())) { return new Triple<>(Signal.NO_ACTION, null, cumulativeLength + fieldLength); } int valuePos = headerStart + headerLength + cumulativeLength; if (fieldLength == 0 || valuePos == 0 || !getComparator().isBinaryComparable(type)) return new Triple<>(Signal.RETURN_VALUE, null, cumulativeLength + fieldLength); bytes.offset = valuePos; final OProperty classProp = iClass.getProperty(iFieldName); return new Triple<>(Signal.RETURN_VALUE, new OBinaryField(iFieldName, type, bytes, classProp != null ? classProp.getCollate() : null), cumulativeLength + fieldLength); }
row.field("MIN", p.getMin() != null ? p.getMin() : ""); row.field("MAX", p.getMax() != null ? p.getMax() : ""); row.field("COLLATE", p.getCollate() != null ? p.getCollate().getName() : ""); row.field("DEFAULT", p.getDefaultValue() != null ? p.getDefaultValue() : "");
return null; return property.getCollate();
if (p.getMax() != null) writer.writeAttribute(0, false, "max", p.getMax()); if (p.getCollate() != null) writer.writeAttribute(0, false, "collate", p.getCollate().getName()); if (p.getDefaultValue() != null) writer.writeAttribute(0, false, "default-value", p.getDefaultValue());
message("\nMaximum value........: " + prop.getMax()); message("\nREGEXP...............: " + prop.getRegexp()); message("\nCollate..............: " + prop.getCollate()); message("\nLinked class.........: " + prop.getLinkedClass()); message("\nLinked type..........: " + prop.getLinkedType());
return new OBinaryField(iFieldName, type, bytes, classProp != null ? classProp.getCollate() : null);
collate = property.getCollate(); mandatory = property.isMandatory(); min = property.getMin();
collate = propertyToIndex.getCollate();