@Override public <T extends DataField> IStructFieldSearchFilterItemEditor createEditorInstance( Collection<StructField<T>> structFields, MatchType matchType) { Collection<TextStructField> textStructFields = CollectionUtil.castCollection(structFields); return new TextStructFieldSearchFilterItemEditor(textStructFields, matchType); }
/** * @ejb.interface-method * @ejb.permission role-name="_Guest_" */ @RolesAllowed("_Guest_") public Set<CSVID> getCSVIDs() { final PersistenceManager pm = createPersistenceManager(); try { final Query q = pm.newQuery(CSV.class); q.setResult("JDOHelper.getObjectId(this)"); final Collection<CSVID> c = CollectionUtil.castCollection((Collection<?>) q.execute()); return new HashSet<CSVID>(c); } finally { pm.close(); } }
public synchronized Collection<TariffPricePair> getTariffPricePairs( ProductTypeID productTypeID, CustomerGroupID customerGroupID, CurrencyID currencyID, ProgressMonitor monitor) { // if (priceConfigID == null) // throw new IllegalArgumentException("priceConfigID must not be null!"); if (productTypeID == null) throw new IllegalArgumentException("productTypeID must not be null!"); if (customerGroupID == null) throw new IllegalArgumentException("customerGroupID must not be null!"); if (currencyID == null) throw new IllegalArgumentException("currencyID must not be null!"); String key = productTypeID.toString() + "::" + customerGroupID.toString() + "::" + currencyID.toString(); // TariffPricePairsCarrier tppc = (TariffPricePairsCarrier) tariffPricePairsCarriers.get(key); TariffPricePairsCarrier tppc = (TariffPricePairsCarrier) cache.get(TariffPricePairDAO.class.getName(), key, (String[]) null, -1); if (tppc == null) { // || System.currentTimeMillis() - tppc.loadDT > EXPIRE_MSEC) { try { SimpleTradeManagerRemote stm = ejbProvider.getRemoteBean(SimpleTradeManagerRemote.class); Collection<TariffPricePair> tariffPricePairs = CollectionUtil.castCollection( stm.getTariffPricePairs( productTypeID, customerGroupID, currencyID, FETCH_GROUPS_TARIFF, FETCH_GROUPS_PRICE)); tppc = new TariffPricePairsCarrier( productTypeID, customerGroupID, currencyID, tariffPricePairs); // tariffPricePairsCarriers.put(key, tppc); // TODO We have to somehow get notified when the appropriate TariffUserSet changes (and // evict the record from the cache). Needs some more thoughts. Marco. cache.put(TariffPricePairDAO.class.getName(), key, tppc, (String[]) null, -1); } catch (Exception e) { throw new RuntimeException(e); } } return tppc.tariffPricePairs; }