@Override public String apply(OProperty input) { return input.getName(); } }));
private static String adjustFieldName(final OClass clazz, final String fieldName) { final OProperty property = clazz.getProperty(fieldName); if (property != null) return property.getName(); else return fieldName; } }
@Override public <T> IFilterCriteria createCollectionFilterCriteria(IModel<Collection<T>> model, IModel<Boolean> join) { OProperty property = propertyModel.getObject(); return new CollectionFilterCriteria(property.getName(), model, join); }
@Override public <T> IFilterCriteria createCollectionFilterCriteria(IModel<Collection<T>> model, IModel<Boolean> join) { OProperty property = propertyModel.getObject(); return new CollectionFilterCriteria(property.getName(), model, join); }
private void propertiesMap(Map<String, OProperty> propertiesMap) { for (OProperty p : properties.values()) { String propName = p.getName(); if (!propertiesMap.containsKey(propName)) propertiesMap.put(propName, p); } for (OClassImpl superClass : superClasses) { superClass.propertiesMap(propertiesMap); } }
private boolean needChangeColor(IColumn<T, S> column) { boolean filter = false; if (column instanceof OPropertyValueColumn) { OPropertyValueColumn valueColumn = (OPropertyValueColumn) column; OProperty property = valueColumn.getCriteryModel().getObject(); if (property != null) { filter = filteredColumns.contains(property.getName()); } } else filteredColumns.contains(column.getSortProperty()); return filter; }
public void getIndexedProperties(Collection<OProperty> indexedProperties) { for (OProperty p : properties.values()) if (areIndexed(p.getName())) indexedProperties.add(p); for (OClassImpl superClass : superClasses) { superClass.getIndexedProperties(indexedProperties); } }
/** * Create {@link OIndex} if required on a current property * @param name name of an index * @param type type of an {@link OIndex} * @return this helper */ public OSchemaHelper oIndex(String name, INDEX_TYPE type) { checkOProperty(); return oIndex(name, type, lastProperty.getName()); }
public void getIndexedProperties(Collection<OProperty> indexedProperties) { for (OProperty p : properties.values()) if (areIndexed(p.getName())) indexedProperties.add(p); initSuperClasses(); for (OImmutableClass superClass : superClasses) { superClass.getIndexedProperties(indexedProperties); } }
private static String resolveSortExpression(OProperty property) { if(property==null || property.getType()==null) return null; Class<?> defType = property.getType().getDefaultJavaType(); return defType!=null && Comparable.class.isAssignableFrom(defType)?property.getName():null; }
@Override public void saveSettings() { super.saveSettings(); ODocument doc = getWidgetDocument(); if(doc!=null) { OProperty property = propertyModel.getObject(); doc.field("property", property.getName()); } }
public int compareTo(final OProperty o) { acquireSchemaReadLock(); try { return globalRef.getName().compareTo(o.getName()); } finally { releaseSchemaReadLock(); } }
public ODocumentLinksQueryDataProvider(IModel<ODocument> docModel, OProperty property) { super("select expand("+property.getName()+") from "+property.getOwnerClass().getName()+" where @rid = :doc"); setParameter("doc", docModel); } }
@Test public void testDateTimeCollection() throws ParseException { DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); List<Date> list = Lists.newArrayList(); list.add(format.parse(DATETIME_VALUE_1)); list.add(format.parse(DATETIME_VALUE_2)); IModel<OProperty> property = wicket.getProperty(DATETIME_FIELD); IFilterCriteriaManager manager = new FilterCriteriaManager(property); manager.addFilterCriteria(manager.createCollectionFilterCriteria(new CollectionModel<>(list), Model.of(true))); queryModel.addFilterCriteriaManager(property.getObject().getName(), manager); assertTrue(queryModel.getObject().size() == 2); }
@Override public PageParameters getPageParameters() { return super.getPageParameters().add("className", getModelObject().getOwnerClass().getName()).add("propertyName", getModelObject().getName()); } }
protected void checkParametersConflict(final OClass baseClass) { final Collection<OProperty> baseClassProperties = baseClass.properties(); for (OProperty property : baseClassProperties) { OProperty thisProperty = getProperty(property.getName()); if (thisProperty != null && !thisProperty.getType().equals(property.getType())) { throw new OSchemaException( "Cannot add base class '" + baseClass.getName() + "', because of property conflict: '" + thisProperty + "' vs '" + property + "'"); } } }
@Override protected OProperty createInstance(OProperty proxy) { OSchema schema = OrientDbWebSession.get().getDatabase().getMetadata().getSchema(); OClass oClass = schema.getClass(className); return oClass.createProperty(proxy.getName(), proxy.getType()); }
@Override protected void buildDashboard() { super.buildDashboard(); //addWidget(ODocumentPropertiesWidget.WIDGET_TYPE_ID); //It will be added automatically! List<? extends OProperty> properties = oClassIntrospector.listProperties(getModelObject().getSchemaClass(), getTab(), true); ODocument widgetDoc; for (OProperty oProperty : properties) { widgetDoc = dashboardManager.createWidgetDocument(ExtendedVisualizerWidget.class); widgetDoc.field("property", oProperty.getName()); addWidget(ExtendedVisualizerWidget.WIDGET_TYPE_ID, widgetDoc); } }