Пример #1
0
  @Override
  public List<I_M_HU_Attribute> retrieveAttributesOrdered(final I_M_HU hu) {
    // NOTE: don't cache on this level. Caching is handled on upper levels

    // there are only some dozen attributes at most, so i think it'S fine to order them after
    // loading
    final List<I_M_HU_Attribute> huAttributes =
        Services.get(IQueryBL.class)
            .createQueryBuilder(I_M_HU_Attribute.class, hu)
            .filter(
                new EqualsQueryFilter<I_M_HU_Attribute>(
                    I_M_HU_Attribute.COLUMNNAME_M_HU_ID, hu.getM_HU_ID()))
            .create()
            .setOnlyActiveRecords(true)
            .list(I_M_HU_Attribute.class);

    // Optimization: set M_HU link
    for (final I_M_HU_Attribute huAttribute : huAttributes) {
      huAttribute.setM_HU(hu);
    }

    // Make sure they are sorted
    Collections.sort(huAttributes, HUAttributesBySeqNoComparator.instance);

    return huAttributes;
  }
Пример #2
0
  private final List<I_M_HU_Attribute> retrieveAttributes(
      final I_M_HU hu, final I_M_Attribute attribute) {
    final List<I_M_HU_Attribute> huAttributes =
        Services.get(IQueryBL.class)
            .createQueryBuilder(I_M_HU_Attribute.class, hu)
            .filter(
                new EqualsQueryFilter<I_M_HU_Attribute>(
                    I_M_HU_Attribute.COLUMNNAME_M_Attribute_ID, attribute.getM_Attribute_ID()))
            .filter(
                new EqualsQueryFilter<I_M_HU_Attribute>(
                    I_M_HU_Attribute.COLUMNNAME_M_HU_ID, hu.getM_HU_ID()))
            .create()
            .setOnlyActiveRecords(true)
            .list(I_M_HU_Attribute.class);

    // Optimization: set M_HU link
    for (final I_M_HU_Attribute huAttribute : huAttributes) {
      huAttribute.setM_HU(hu);
    }

    return huAttributes;
  }