问题列表 - 第28351页

如何在HQL/GORM中表达"动态列表中的值"?

对于grails应用程序,我需要找到一个对象列表,其中"attr"是动态字符串列表中的一个.实际的HQL查询更复杂,但我需要帮助的是这个:

def result = MyObject.executeQuery("select o from MyObject as o where o.attr in :list",
    [list: aListOfStrings])
Run Code Online (Sandbox Code Playgroud)

这显然不是正确的语法,Grails将它作为"意外令牌"抛回给我,作为:list参数.

这在HQL中是否可行?我并不特别想在代码库的这一部分使用Criteria.

grails hql grails-orm

6
推荐指数
1
解决办法
9227
查看次数

Clean way in GWT/Java to wait for multiple asynchronous events to finish

What is the best way to wait for multiple asynchronous callback functions to finish in Java before continuing. Specifically I'm using GWT with AsyncCallback, but I think this is a generic problem. Here's what I have now, but surely there is cleaner way...

    AjaxLoader.loadApi("books", "0", new Runnable(){
        public void run() {
            bookAPIAvailable = true;
            ready();
        }}, null);
    AjaxLoader.loadApi("search", "1", new Runnable(){
        public void run() {
            searchAPIAvailable = true;
            ready();
        }}, null);


    loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() {
        public void onSuccess(LoginInfo result) { …
Run Code Online (Sandbox Code Playgroud)

java gwt google-ajax-api

39
推荐指数
3
解决办法
3万
查看次数

LINQ to SQL SOUNDEX - possible?

I have done a little bit of research on this and looked through a few articles both here on StackOverflow as well as some blog posts, but haven't found an exact answer. I also read that it is possible to do it using the 4.0 framework, but have yet to find any supporting evidence.

So my question, is it possible to perform SOUNDEX via a LINQ to SQL Query?

sql soundex linq-to-sql

10
推荐指数
3
解决办法
6044
查看次数

如何创建具有基本依赖项的 deb 包?

您好,我正在尝试为用 Java 编写的 Web 应用程序创建一个 deb 包(它使用 Apache Tomcat)。我的最终目标是启动一个人们可以添加到apt-get软件中的存储库,但是

  1. 如何使包知道寻找像 tomcat、sun-java6-bin 和 ant 这样的依赖项?

  2. 如何编写安装程序脚本以将文件和文件夹放置在正确的位置?

java ubuntu debian packaging debian-based

5
推荐指数
1
解决办法
6603
查看次数

How to use Unicode (UTF-8) in C++

Possible Duplicate:
Unicode in C++

If I remembered correctly, the default character and string encoding in C++ are ASCII. Is there a simple way to enable Unicode support?

c++ unicode

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

使用IN和子查询进行MYSQL更新

嗨我有这样的表:

表格条目:

id | total_comments
_____________________
1 | 0
2 | 0
3 | 0
4 | 0

表评论:

id | 开斋节 评论
_____________________
1 | 1 | 评论sdfd
2 | 1 | 测试测试
3 | 1 | 评论文本
4 | 2 | 虚拟评论
5 | 2 | 样本评论
6 | 1 | fg fgh dfh

我写的查询:

UPDATE entry 
   SET total_comments = total_comments + 1 
 WHERE id IN ( SELECT eid 
                 FROM comments 
                WHERE id IN (1,2,3,4,5,6))
Run Code Online (Sandbox Code Playgroud)

我得到的结果是:

表格条目:

id …

mysql subquery sql-view sql-update

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

Android - Linkify Problem

I seem to be having trouble with the linkify I am using in my Custom Adapter. For some reason I recieve the following stack track when I click on one of the links:

06-07 20:49:34.696: ERROR/AndroidRuntime(813): Uncaught handler: thread main exiting due to uncaught exception
06-07 20:49:34.745: ERROR/AndroidRuntime(813): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.app.ApplicationContext.startActivity(ApplicationContext.java:550)
06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:248)
06-07 20:49:34.745: ERROR/AndroidRuntime(813): …
Run Code Online (Sandbox Code Playgroud)

android linkify

5
推荐指数
1
解决办法
3569
查看次数

Creating Slugs from Titles?

I have everything in place to create slugs from titles, but there is one issue. My RegEx replaces spaces with hyphens. But when a user types "Hi     there" (multiple spaces) the slug ends up as "Hi-----there". When really it should be "Hi-there".

Should I create the regular expression so that it only replaces a space when there is a character either side?

Or is there an easier way to do this?

javascript regex slug

6
推荐指数
3
解决办法
2102
查看次数

Turning off JBoss hot deploy service?

What is the correct way to turn off the JBoss hot deploy service?

This is a production environment.

Edit: JBoss version 5.1.0 GA

deployment jboss application-server

6
推荐指数
1
解决办法
6791
查看次数

如何格式化表达式语言中的数字?

如何为EL中的数字(例如longBigDecimal)制作格式化输出?例如,我想将一些十进制数限制为3英寸

${result.returnValue.contract.balance}
Run Code Online (Sandbox Code Playgroud)

java jsp jstl el

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