小编daz*_*zle的帖子

将参数数组设置为休眠查询语言

目前,查询采用单个reportID来返回结果.现在,如果我想传递多个reportID并仅在1次调用DB中返回o/p,我该怎么做?

String queryText = "from com.abc.domain.bcd.Report report  where report.reportID in :reportId";

    Query query = SessionFactory.getCurrentSession().createQuery(queryText.toString());

    query.setParameter("reportID", reportId);

    query.list();
Run Code Online (Sandbox Code Playgroud)

我尝试传递为arrayList但没有运气.得到以下错误

List<String> reportID= new ArrayList<String>();
    reportID.add("aaa");
    reportID.add("bbb");
Run Code Online (Sandbox Code Playgroud)

java.util.ArrayList与java.lang.String不兼容

hibernate hql

9
推荐指数
1
解决办法
2万
查看次数

Java 6中的Normalizer.getClass(c)方法的替换

getClass(char c)从Java 6开始,似乎缺少Normalizer类的方法.

此方法存在于我们的遗留代码中,正在使用,如下所示.我们需要将它迁移到Java 6.有关如何替换它的任何建议吗?

import sun.text.Normalizer;

 /**
 * Returns an array of strings that have all the possible
 * permutations of the characters in the input string.
 * This is used to get a list of all possible orderings
 * of a set of combining marks. Note that some of the permutations
 * are invalid because of combining class collisions, and these
 * possibilities must be removed because they are not canonically
 * equivalent.
 */
private String[] producePermutations(String …
Run Code Online (Sandbox Code Playgroud)

java

8
推荐指数
1
解决办法
408
查看次数

HTML5 localStorage

什么可能是HTML5 localStorage的真正实际用途?

html5 local-storage

7
推荐指数
1
解决办法
1185
查看次数

斜杠之间提取字符串

从下面的网址,我试图提取2串即String a = "region/country";String b = "123xyz";我试着用的重载方法的IndexOf,但同样没有帮助.有什么指针吗?

String URL = "http://abcd.com/region/country/state/123xyzCONSTANTTEXT.html";
Run Code Online (Sandbox Code Playgroud)

java string

4
推荐指数
2
解决办法
3520
查看次数

在xslt中显示变量的值

嗨,我想以百分比格式填充宽度中的maxbars变量的值,但由于某些原因,它没有取其值.你能帮忙吗?

示例:我想将其显示为宽度:10.9%格式

<xsl:for-each select="catalog/cd/price">
 Current node:
 <xsl:variable name="maxbars" select="."/>
 <div style="width: 200px; height: 20px;">
 <div style="width: maxbars%; height: 18px; background-color: red"></div>
 </div>
 <br/>
 </xsl:for-each>



<catalog>
<cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
</cd>
<cd>
    <title>Hide your heart</title>
    <artist>Bonnie Tyler</artist>
    <country>UK</country>
    <company>CBS Records</company>
    <price>9.90</price>
    <year>1988</year>
</cd>
Run Code Online (Sandbox Code Playgroud)

xml xslt

2
推荐指数
1
解决办法
2万
查看次数

正则表达式接受除字母、数字之外的任何内容

需要有关正则表达式的帮助,该正则表达式可接受除字母(Aa-Zz)、数字(0-9)和@之外的任何内容

例如 diff 输入类型

bony -> fail
gup12-> fail
@    -> fail
!#$  -> pass
*&%  -> pass 
Run Code Online (Sandbox Code Playgroud)

regex

-4
推荐指数
1
解决办法
595
查看次数

标签 统计

java ×2

hibernate ×1

hql ×1

html5 ×1

local-storage ×1

regex ×1

string ×1

xml ×1

xslt ×1