目前,查询采用单个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不兼容
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) 从下面的网址,我试图提取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) 嗨,我想以百分比格式填充宽度中的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)
需要有关正则表达式的帮助,该正则表达式可接受除字母(Aa-Zz)、数字(0-9)和@之外的任何内容
例如 diff 输入类型
bony -> fail
gup12-> fail
@ -> fail
!#$ -> pass
*&% -> pass
Run Code Online (Sandbox Code Playgroud)