小编Yar*_*voy的帖子

Grails:如何将域对象的错误与命令对象的错误结合起来?

假设我有User域类和RegistrationCommand类.因此,当用户在网站上注册时,有两个步骤进行数据验证:

  1. RegistrationCommand约束验证.
  2. 用户域对象约束验证.

控制器动作接收命令对象并在计算后将其传递给模型中的视图.因此,我想将命令对象的错误加入域对象的验证错误,并将它们作为命令对象的一部分传递.最好的方法是什么?

dns validation error-handling grails command

13
推荐指数
2
解决办法
7106
查看次数

如何调试部署的Grails应用程序

有没有办法在Intellij IDEA或任何其他IDE中调试部署到生产服务器的Grails应用程序?

ide debugging grails intellij-idea

7
推荐指数
2
解决办法
7341
查看次数

如何通过选择异物字段的值来构建查询

使用外来对象字段的值查询的最佳方法是什么?

假设我有这三个类.

描述单位数量的UnitResult类:

@DatabaseTable
public class UnitResult {
    public static final String ID_FIELD_NAME = "id";
    public static final String UNIT_COLUMN_NAME = "unit";
    public static final String RESULT_COLUMN_NAME = "result";

    @DatabaseField(generatedId = true, columnName = ID_FIELD_NAME)
    public Integer id;

    @DatabaseField(foreign = true, canBeNull = false, columnName = UNIT_COLUMN_NAME)
    public Unit unit;

    @DatabaseField(canBeNull = true, columnName = RESULT_COLUMN_NAME)
    public Integer result = null;
}
Run Code Online (Sandbox Code Playgroud)

描述市场中某些单位的单位类(例如jiuce,snack等):

@DatabaseTable
public class Unit {
    public static final String ID_FIELD_NAME = "id";
    public static final String TYPE_FIELD_NAME …
Run Code Online (Sandbox Code Playgroud)

java android query-builder ormlite

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