@Override public boolean isNotNull() { return delegate.isNotNull(); }
private void modifyCaseInsensitiveNameField(final OClass type) { log.info("Modifying case-insensitive name field on component"); OProperty ciNameProperty = type.getProperty(P_CI_NAME); if (!ciNameProperty.isMandatory()) { ciNameProperty.setMandatory(true); } if (!ciNameProperty.isNotNull()) { ciNameProperty.setNotNull(true); } }
@Override public void afterRegistration(final ODatabaseObject db, final SchemeDescriptor descriptor, final Field field, final ONotNull annotation) { final String name = field.getName(); final boolean notnull = annotation.value(); final OProperty property = db.getMetadata().getSchema() .getClass(descriptor.schemeClass).getProperty(name); if (property.isNotNull() != notnull) { property.setNotNull(notnull); logger.debug("Set {}.{} property notnull={}", descriptor.schemeClass, name, notnull); } } }
@Override protected void onPostResolveComponent(Component component, OProperty critery) { super.onPostResolveComponent(component, critery); if(component instanceof FormComponent) { if(critery.isNotNull()) ((FormComponent<?>)component).setRequired(true); ((FormComponent<?>)component).add(new OPropertyValueValidator<Object>(critery, getEntityModel())); } }
if (cls != null) for (OProperty p : cls.properties()) { if (p.isMandatory() || p.isNotNull() || !p.getOwnerClass().getInvolvedIndexes(p.getName()).isEmpty()) return false;
.setNullValid(!property.isNotNull());
if (cls != null) for (OProperty p : cls.properties()) { if (p.isMandatory() || p.isNotNull()) return false;
row.field("MANDATORY", p.isMandatory()); row.field("READONLY", p.isReadonly()); row.field("NOT-NULL", p.isNotNull()); row.field("MIN", p.getMin() != null ? p.getMin() : ""); row.field("MAX", p.getMax() != null ? p.getMax() : "");
private static RecordType getRecordType(OClass oClass) { RecordType type = new RecordType(oClass.getName()); for (OProperty oProperty : oClass.properties()) { OType oType = oProperty.getType(); Class javaType = oType.getDefaultJavaType(); if (oType == OType.LINK) { javaType = RecordId.class; } FieldDefinition field = new FieldDefinition(oProperty.getName(), javaType); field.withNotNull(oProperty.isNotNull()); for (OIndex oIndex : oProperty.getAllIndexes()) { OIndexDefinition def = oIndex.getDefinition(); if (def.isAutomatic() && def.getFields().size() == 1) { boolean unique = oIndex.getType().equalsIgnoreCase(INDEX_TYPE.UNIQUE.name()); field.withIndexed(true).withUnique(unique); } } type.withField(field); } type.withStrict(oClass.isStrictMode()); OClass oSuperClass = oClass.getSuperClass(); if (oSuperClass != null) { type.withSuperType(getRecordType(oSuperClass)); } type.withAbstract(oClass.isAbstract()); return type; }
message("\nType.................: " + prop.getType()); message("\nMandatory............: " + prop.isMandatory()); message("\nNot null.............: " + prop.isNotNull()); message("\nRead only............: " + prop.isReadonly()); message("\nDefault value........: " + prop.getDefaultValue());
private OResultInternal getPropertyAsDocument(final OClass clazz, final OProperty prop) { database.activateOnCurrentThread(); final OType type = prop.getType(); OResultInternal res = new OResultInternal(); res.setProperty("TABLE_CAT", database.getName()); res.setProperty("TABLE_SCHEM", database.getName()); res.setProperty("TABLE_NAME", clazz.getName()); res.setProperty("COLUMN_NAME", prop.getName()); res.setProperty("DATA_TYPE", OrientJdbcResultSetMetaData.getSqlType(type)); res.setProperty("TYPE_NAME", type.name()); res.setProperty("COLUMN_SIZE", 1); res.setProperty("BUFFER_LENGTH", null); res.setProperty("DECIMAL_DIGITS", null); res.setProperty("NUM_PREC_RADIX", 10); res.setProperty("NULLABLE", !prop.isNotNull() ? columnNoNulls : columnNullable); res.setProperty("REMARKS", prop.getDescription()); res.setProperty("COLUMN_DEF", prop.getDefaultValue()); res.setProperty("SQL_DATA_TYPE", null); res.setProperty("SQL_DATETIME_SUB", null); res.setProperty("CHAR_OCTET_LENGTH", null); res.setProperty("ORDINAL_POSITION", prop.getId()); res.setProperty("IS_NULLABLE", prop.isNotNull() ? "NO" : "YES"); return res; }
OProperty p = getProperty(); if (fieldValue == null) { if (p.isNotNull()) { validatable.error(newValidationError("required")); } else if (p.isMandatory() && Strings.isEmpty(p.getDefaultValue())) {
OProperty p = getProperty(); if (fieldValue == null) { if (p.isNotNull()) { validatable.error(newValidationError("required")); } else if (p.isMandatory() && Strings.isEmpty(p.getDefaultValue())) {
notNull = property.isNotNull(); collate = property.getCollate(); mandatory = property.isMandatory();