Examples of DictionaryCategory


Examples of com.github.dactiv.showcase.entity.foundation.variable.DictionaryCategory

   
    List<DictionaryCategory> result = new ArrayList<DictionaryCategory>();
   
    for (DictionaryCategory r : list) {
      if (r.getParent() == null) {
        DictionaryCategory temp = new DictionaryCategory();
        BeanUtils.copyProperties(r, temp);
        mergeToParent(list,temp);
        result.add(temp);
      }
    }
View Full Code Here

Examples of com.github.dactiv.showcase.entity.foundation.variable.DictionaryCategory

    parent.setLeaf(false);
   
    for (DictionaryCategory r: list) {
     
      if (StringUtils.equals(r.getParentId(),parent.getId())) {
        DictionaryCategory temp = new DictionaryCategory();
        BeanUtils.copyProperties(r, temp);
        temp.setChildren(null);
        mergeToParent(list,temp);
        parent.getChildren().add(temp);
        parent.setLeaf(true);
      }
     
View Full Code Here

Examples of com.github.dactiv.showcase.entity.foundation.variable.DictionaryCategory

   *
   */
  @ModelAttribute("entity")
  public DictionaryCategory bindingModel(String id) {

    DictionaryCategory category = new DictionaryCategory();
   
    if (StringUtils.isNotEmpty(id)) {
      category = systemDictionaryManager.getDictionaryCategory(id);
    }

View Full Code Here

Examples of com.github.dactiv.showcase.entity.foundation.variable.DictionaryCategory

  private SystemVariableManager systemVariableManager;
 
  @Test
  @Transactional
  public void testSaveDictionaryCategory() {
    DictionaryCategory category = new DictionaryCategory();
    category.setCode("test");
    category.setName("测试");
    category.setRemark("*");
   
    int beforeRow = countRowsInTable("TB_DICTIONARY_CATEGORY");
    systemVariableManager.saveDictionaryCategory(category);
    int afterRow = countRowsInTable("TB_DICTIONARY_CATEGORY");
   
    assertEquals(afterRow, beforeRow + 1);
    assertFalse(category.getLeaf());
   
    DictionaryCategory parent = systemVariableManager.getDictionaryCategory("402881e437d47b250137d485274b0005");
    category.setParent(parent);
    systemVariableManager.saveDictionaryCategory(category);
    assertTrue(parent.getLeaf());
    category.setParent(null);
    systemVariableManager.saveDictionaryCategory(category);
    assertFalse(parent.getLeaf());
  }
View Full Code Here

Examples of com.github.dactiv.showcase.entity.foundation.variable.DictionaryCategory

  }
 
  @Test
  public void testSaveDataDictionary() {
   
    DictionaryCategory category = systemVariableManager.getDictionaryCategory("402881e437d467d80137d46fc0e50001");
   
    DataDictionary dataDictionary = new DataDictionary();
    dataDictionary.setCategory(category);
    dataDictionary.setName("test");
    dataDictionary.setValue("4");
View Full Code Here

Examples of org.dayatang.persistence.test.domain.DictionaryCategory

        graduate = createDictionary("02", "研究生", education, 200, "05");
        associate = createDictionary("03", "专科", education, 300, "05");
    }

    private DictionaryCategory createCategory(String name, int sortOrder) {
        DictionaryCategory category = new DictionaryCategory();
        category.setName(name);
        category.setSortOrder(sortOrder);
        repository.save(category);
        repository.flush();
        return category;
    }
View Full Code Here

Examples of org.dayatang.persistence.test.domain.DictionaryCategory

        assertTrue(results.contains(education));
    }

    @Test
    public void testIsEmpty() {
        DictionaryCategory empty = createCategory("a", 3);
        instance2.isEmpty("dictionaries");
        List<DictionaryCategory> results = repository.find(instance2);
        assertTrue(results.contains(empty));
        assertFalse(results.contains(gender));
        assertFalse(results.contains(education));
View Full Code Here

Examples of org.dayatang.persistence.test.domain.DictionaryCategory

        assertFalse(results.contains(education));
    }

    @Test
    public void testNotEmpty() {
        DictionaryCategory empty = createCategory("a", 3);
        instance2.notEmpty("dictionaries");
        List<DictionaryCategory> results = repository.find(instance2);
        assertFalse(results.contains(empty));
        assertTrue(results.contains(gender));
        assertTrue(results.contains(education));
View Full Code Here

Examples of org.dayatang.persistence.test.domain.DictionaryCategory

        List<Dictionary> results = repository.find(instance.eq("category.name", "education"));
        assertTrue(results.contains(undergraduate));
    }

    private DictionaryCategory createCategory(String name, int sortOrder) {
        DictionaryCategory category = new DictionaryCategory();
        category.setName(name);
        category.setSortOrder(sortOrder);
        repository.save(category);
        repository.flush();
        return category;
    }
View Full Code Here

Examples of org.dayatang.persistence.test.domain.DictionaryCategory

        assertTrue(results.contains(education));
    }

    @Test
    public void testIsEmpty() {
        DictionaryCategory empty = createCategory("a", 3);
        instance = repository.createCriteriaQuery(DictionaryCategory.class);
        List<DictionaryCategory> results = instance.isEmpty("dictionaries").list();
        assertTrue(results.contains(empty));
        assertFalse(results.contains(gender));
        assertFalse(results.contains(education));
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.