Examples of Indexed


Examples of com.vaadin.data.Container.Indexed

     */
    @Test
    public void testWithIndexedContainer() {

        // Create a container to use as a datasource
        Indexed container = createTestIndexedContainer();

        // Set datasource
        calendar.setContainerDataSource(container, "testCaption",
                "testDescription", "testStartDate", "testEndDate", null);

        // Start and end dates to query for
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.setTime((Date) container.getItem(container.getIdByIndex(0))
                .getItemProperty("testStartDate").getValue());
        Date start = cal.getTime();
        cal.add(java.util.Calendar.MONTH, 1);
        Date end = cal.getTime();

        // Test the all events are returned
        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                start, end);
        assertEquals(container.size(), events.size());

        // Check that event values are present
        CalendarEvent e = events.get(0);
        assertEquals("Test 1", e.getCaption());
        assertEquals("Description 1", e.getDescription());
        assertTrue(e.getStart().compareTo(start) == 0);

        // Test that a certain range is returned
        cal.setTime((Date) container.getItem(container.getIdByIndex(6))
                .getItemProperty("testStartDate").getValue());
        end = cal.getTime();
        events = calendar.getEventProvider().getEvents(start, end);
        assertEquals(6, events.size());
    }
View Full Code Here

Examples of com.vaadin.data.Container.Indexed

    }

    @Test
    public void testNullLimitsBeanItemContainer() {
        // Create a container to use as a datasource
        Indexed container = createTestBeanItemContainer();

        // Start and end dates to query for
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.setTime(((CalendarEvent) container.getIdByIndex(0)).getStart());
        Date start = cal.getTime();
        cal.add(java.util.Calendar.MONTH, 1);
        Date end = cal.getTime();

        // Set datasource
        calendar.setContainerDataSource(container);

        // Test null start time
        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                null, end);
        assertEquals(container.size(), events.size());

        // Test null end time
        events = calendar.getEventProvider().getEvents(start, null);
        assertEquals(container.size(), events.size());

        // Test both null times
        events = calendar.getEventProvider().getEvents(null, null);
        assertEquals(container.size(), events.size());
    }
View Full Code Here

Examples of com.vaadin.data.Container.Indexed

    }

    @Test
    public void testNullLimitsIndexedContainer() {
        // Create a container to use as a datasource
        Indexed container = createTestIndexedContainer();

        // Start and end dates to query for
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.setTime((Date) container.getItem(container.getIdByIndex(0))
                .getItemProperty("testStartDate").getValue());
        Date start = cal.getTime();
        cal.add(java.util.Calendar.MONTH, 1);
        Date end = cal.getTime();

        // Set datasource
        calendar.setContainerDataSource(container, "testCaption",
                "testDescription", "testStartDate", "testEndDate", null);

        // Test null start time
        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                null, end);
        assertEquals(container.size(), events.size());

        // Test null end time
        events = calendar.getEventProvider().getEvents(start, null);
        assertEquals(container.size(), events.size());

        // Test both null times
        events = calendar.getEventProvider().getEvents(null, null);
        assertEquals(container.size(), events.size());
    }
View Full Code Here

Examples of org.cruxframework.crux.core.client.db.annotation.Store.Indexed

    List<JMethod> getterMethods = JClassUtils.getGetterMethods(objectStoreTarget);
    for (JMethod method : getterMethods)
        {
          if (JClassUtils.isSimpleType(method.getReturnType()))
          {
            Indexed indexed = method.getAnnotation(Indexed.class);
            if (indexed != null)
            {
              String property = JClassUtils.getPropertyForGetterOrSetterMethod(method);
              if (!isValidTypeForKey(method.getReturnType()))
              {
                throw new CruxGeneratorException("Invalid index type for index on method ["+method.getReadableDeclaration()+"]. Crux databases only support Strings, integers, double or dates as part of a key or index");
              }
              result.add(new IndexData(new String[]{prefix+property}, indexed.unique(), false, prefix+property));
            }
          }
          else
          {
            String property = JClassUtils.getPropertyForGetterOrSetterMethod(method);
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

    //FIXME I'm inclined to get rid of the default value
    PersistentClass pc = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( pc.getMappedClass() );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
        else {
          rootIndex = currentClazz;
        }
      }
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

    //FIXME I'm inclined to get rid of the default value
    Class<?> aClass = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( aClass );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
        else {
          rootIndex = currentClazz;
        }
      }
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

      for ( IndexManager manager : providers ) {
        setSimilarity( similarityInstance, manager );
      }
    }

    Indexed indexedAnnotation = entity.getAnnotation( Indexed.class );
    EntityIndexingInterceptor<?> interceptor = null;
    if ( indexedAnnotation != null ) {
      Class<? extends EntityIndexingInterceptor> interceptorClass = getInterceptorClassFromHierarchy(
          entity,
          indexedAnnotation
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

      superEntity = superEntity.getSuperclass();
      //Object.class
      if ( superEntity == null ) {
        return result;
      }
      Indexed indexAnnForSuperclass = superEntity.getAnnotation( Indexed.class );
      result = indexAnnForSuperclass != null ?
          indexAnnForSuperclass.interceptor() :
          result;
    }
    return result;
  }
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

    //FIXME I'm inclined to get rid of the default value
    Class<?> aClass = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( aClass );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
        else {
          rootIndex = currentClazz;
        }
      }
View Full Code Here

Examples of org.hibernate.search.annotations.Indexed

      for ( IndexManager manager : providers ) {
        setSimilarity( similarityInstance, manager );
      }
    }

    Indexed indexedAnnotation = entity.getAnnotation( Indexed.class );
    EntityIndexingInterceptor<?> interceptor = null;
    if (indexedAnnotation != null) {
      Class<? extends EntityIndexingInterceptor> interceptorClass = getInterceptorClassFromHierarchy(
          entity,
          indexedAnnotation
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.