@Override @Deprecated public OClass getSuperClass() { return delegate.getSuperClass(); }
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException { database.activateOnCurrentThread(); final OClass cls = database.getMetadata().getSchema().getClass(typeNamePattern); final OInternalResultSet resultSet = new OInternalResultSet(); if (cls != null && cls.getSuperClass() != null) { final OResultInternal res = new OResultInternal(); res.setProperty("TABLE_CAT", catalog); res.setProperty("TABLE_SCHEM", catalog); res.setProperty("TABLE_NAME", cls.getName()); res.setProperty("SUPERTYPE_CAT", catalog); res.setProperty("SUPERTYPE_SCHEM", catalog); res.setProperty("SUPERTYPE_NAME", cls.getSuperClass().getName()); resultSet.add(res); } return new OrientJdbcResultSet(new OrientJdbcStatement(connection), resultSet, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT); }
public ResultSet getSuperTables(final String catalog, final String schemaPattern, final String tableNamePattern) throws SQLException { database.activateOnCurrentThread(); final OClass cls = database.getMetadata().getSchema().getClass(tableNamePattern); final OInternalResultSet resultSet = new OInternalResultSet(); if (cls != null && cls.getSuperClass() != null) { final OResultInternal res = new OResultInternal(); res.setProperty("TABLE_CAT", catalog); res.setProperty("TABLE_SCHEM", catalog); res.setProperty("TABLE_NAME", cls.getName()); res.setProperty("SUPERTABLE_CAT", catalog); res.setProperty("SUPERTABLE_SCHEM", catalog); res.setProperty("SUPERTABLE_NAME", cls.getSuperClass().getName()); resultSet.add(res); } return new OrientJdbcResultSet(new OrientJdbcStatement(connection), resultSet, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT); }
break; fieldName = superClz.getCustom(attr); superClz = superClz.getSuperClass();
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; }