Example usage for java.lang Long toString

List of usage examples for java.lang Long toString

Introduction

In this page you can find the example usage for java.lang Long toString.

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this Long 's value.

Usage

From source file:com.ewcms.content.particular.dao.FrontEnterpriseBasicDAO.java

public List<EnterpriseBasic> findEnterpriseBasicBySector(Long organId) {
    String hql = "From EnterpriseBasic As p where p.organ.id=:organId and p.release=true Order By p.published desc ";
    TypedQuery<EnterpriseBasic> query = this.getEntityManager().createQuery(hql, EnterpriseBasic.class);
    query.setParameter("organId", Integer.valueOf(organId.toString()));
    return query.getResultList();
}

From source file:com.ewcms.content.particular.dao.FrontProjectBasicDAO.java

public List<ProjectBasic> findProjectBasicBySector(Long organId) {
    String hql = "From ProjectBasic As p where p.organ.id=:organId and p.release=true Order By p.published desc ";
    TypedQuery<ProjectBasic> query = this.getEntityManager().createQuery(hql, ProjectBasic.class);
    query.setParameter("organId", Integer.valueOf(organId.toString()));
    return query.getResultList();
}

From source file:com.shopzilla.publisher.service.CategorySearchService.java

public CatalogResponse keywordSearch(Long categoryId, Integer numResults, String keyword) {
    ProductSearchRequest productSearchRequest = new ProductSearchRequest();
    productSearchRequest.setApiKey(apiKey);
    productSearchRequest.setPublisherId(publisherId);
    productSearchRequest.setCategoryId(categoryId.toString());
    productSearchRequest.setNumResults(numResults);
    productSearchRequest.setKeyword(keyword);
    productSearchRequest.setShowAttributes(Boolean.TRUE);

    return restCatalogAPIClient.performSearch(productSearchRequest);
}

From source file:com.redhat.rhn.frontend.action.multiorg.OrgSystemSubscriptionsAction.java

/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping, ActionForm formIn, HttpServletRequest request,
        HttpServletResponse response) {/*from w  ww  .  j  ava  2  s . c o m*/
    DynaActionForm dynaForm = (DynaActionForm) formIn;
    RequestContext ctx = new RequestContext(request);
    Long oid = ctx.getParamAsLong(RequestContext.ORG_ID);
    Org org = OrgFactory.lookupById(oid);

    ActionForward retval = getStrutsDelegate().forwardParam(mapping.findForward(RhnHelper.DEFAULT_FORWARD),
            "oid", oid.toString());

    if (isSubmitted(dynaForm)) {
        ActionErrors ae = updateSubscriptions(org, dynaForm, request);
        if (ae != null && ae.size() > 0) {
            getStrutsDelegate().saveMessages(request, ae);
            retval = getStrutsDelegate().forwardParam(mapping.findForward("error"), "oid", oid.toString());
        } else {
            createSuccessMessage(request, "org.entitlements.syssoft.success", null);
            retval = getStrutsDelegate().forwardParam(mapping.findForward("success"), "oid", oid.toString());
        }
    }
    setupFormValues(org, ctx, dynaForm, OrgManager.listEntitlementsFor(org));
    return retval;
}

From source file:com.shopzilla.publisher.service.CategorySearchService.java

public CatalogResponse attributeSearch(Long categoryId, Integer numResults, String attFilter) {
    ProductSearchRequest productSearchRequest = new ProductSearchRequest();
    productSearchRequest.setApiKey(apiKey);
    productSearchRequest.setPublisherId(publisherId);
    productSearchRequest.setCategoryId(categoryId.toString());
    productSearchRequest.setNumResults(numResults);
    productSearchRequest.setAttFilter(attFilter);
    productSearchRequest.setShowAttributes(Boolean.TRUE);

    return restCatalogAPIClient.performSearch(productSearchRequest);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMssCF.CFAccMssCFBindAccountConfigEmpContactListTenantId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFAccMssCFBindAccountConfigEmpContactListTenantId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from   ww w. j  av a 2  s .  c o m*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFAccAccountConfigObj) {
        Long empContactListTenantId = ((ICFAccAccountConfigObj) genDef).getOptionalEmpContactListTenantId();
        if (empContactListTenantId == null) {
            ret = null;
        } else {
            ret = empContactListTenantId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFAccAccountConfigObj");
    }

    return (ret);
}

From source file:com.bazzar.base.dao.redis.ItemRepository.java

public Long addJob(JSONObject json) {
    Long jobId = jobIdCounter.incrementAndGet();
    final Map<String, Object> jobParams = new HashMap<String, Object>();

    jobParams.put("id", jobId);
    jobParams.put("params", json.toString());
    jobParams.put("status", "pending");
    template.opsForHash().putAll(jobId.toString(), jobParams);

    return jobId;
}

From source file:com.google.code.ssm.test.ReadThroughMultiCacheTest.java

@Test
public void testMemcached() throws TimeoutException, CacheException {
    // final MemcachedClientIF cache = (MemcachedClientIF) context.getBean("memcachedClient");

    final List<String> keys = new ArrayList<String>();
    final Map<String, String> answerMap = new HashMap<String, String>();
    final Long now = new Date().getTime();
    final String alphabet = "abcdefghijklmnopqrstuvwxyz";
    for (int ix = 0; ix < 5; ix++) {
        final String key = alphabet.charAt(ix) + now.toString();
        final String value = alphabet.toUpperCase().charAt(ix) + "00000";
        cache.set(key, 30, value, null);
        keys.add(key);/*from w  ww  .jav  a 2 s  . co m*/
        answerMap.put(key, value);
    }

    final Map<String, Object> memcachedSez = cache.getBulk(keys, null);

    assertTrue(memcachedSez.equals(answerMap));

}

From source file:org.flite.cach3.test.InvalidateMultiCacheTest.java

@Test
public void testVelocity() {
    final TestSvc test = (TestSvc) context.getBean("testSvc");
    final StubInvalidateMultiCacheListenerImpl listener = (StubInvalidateMultiCacheListenerImpl) context
            .getBean("stubIM");

    final String original = RandomStringUtils.randomAlphanumeric(10);
    final String replace = RandomStringUtils.randomAlphanumeric(8);
    final Long second = 10661337L;

    final long base = RandomUtils.nextInt(2000) + 4000;
    final List<Long> keys = new ArrayList<Long>();
    final List<Long> invalidSubset = new ArrayList<Long>();
    final List<String> baseKeys = new ArrayList<String>();
    for (int ix = 0; ix < 4; ix++) {
        final Long id = base + ix;
        keys.add(id);//  ww  w. j  av  a  2s  .  c  o m
        if (ix % 2 == 0) {
            invalidSubset.add(id);
            baseKeys.add(id.toString() + "&&" + second.toString());
        }
    }

    // Set up the cache via the read-thru.
    final List<String> r1 = test.getCompoundStrings(keys, original, second);
    for (final String str : r1) {
        assertEquals(original, str);
    }

    final int previous = listener.getTriggers().size();
    test.invalidateCompoundStrings(second, invalidSubset);

    // Make sure the listener is getting triggered.
    // Testing that the listener got invoked as required.
    assertTrue("Doesn't look like the listener got called.", listener.getTriggers().size() == previous + 1);
    final String expected = StubInvalidateMultiCacheListenerImpl.formatTriggers(TestDAOImpl.COMPOUND_NAMESPACE,
            TestDAOImpl.COMPOUND_PREFIX, baseKeys, null, new Object[] { second, invalidSubset });
    assertEquals(expected, listener.getTriggers().get(listener.getTriggers().size() - 1));

    // Now we ensure that the invalidation occurred.
    final List<String> r2 = test.getCompoundStrings(keys, replace, second);
    for (int ix = 0; ix < keys.size(); ix++) {
        if (invalidSubset.contains(keys.get(ix))) {
            assertEquals(replace, r2.get(ix));
        } else {
            assertEquals(original, r2.get(ix));
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashMssCF.CFGCashMssCFBindAccountConfigEmpContactListTenantId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFGCashMssCFBindAccountConfigEmpContactListTenantId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from  w  ww  .j  a  v  a  2 s .c om*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFGCashAccountConfigObj) {
        Long empContactListTenantId = ((ICFGCashAccountConfigObj) genDef).getOptionalEmpContactListTenantId();
        if (empContactListTenantId == null) {
            ret = null;
        } else {
            ret = empContactListTenantId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFGCashAccountConfigObj");
    }

    return (ret);
}