假设我有User域类和RegistrationCommand类.因此,当用户在网站上注册时,有两个步骤进行数据验证:
控制器动作接收命令对象并在计算后将其传递给模型中的视图.因此,我想将命令对象的错误加入域对象的验证错误,并将它们作为命令对象的一部分传递.最好的方法是什么?
有没有办法在Intellij IDEA或任何其他IDE中调试部署到生产服务器的Grails应用程序?
使用外来对象字段的值查询的最佳方法是什么?
假设我有这三个类.
描述单位数量的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)