嗨我有一個簡單的應用程序,我正在構建,並且遇到有人輸入無效信息或根本沒有信息到字段時出現錯誤消息出現問題。 我正在使用的表單是註冊一個新用戶,與用戶和表單關聯的代碼如下所示; users_controller.rb Class UsersController < ApplicationController
def index
@users = User.all
e
我會在哪裏放置CreateOrder()業務邏輯? class Order // this is an entity model for DbContext
{
public int Id { set; get; }
public String name { set; get; }
}
public void CreateOrder(Details details)
我哈瓦的模型,我需要驗證模型eclipselink JPA 和我添加如果空anotation @NotEmpty驗證的名字,但是當我保存/持續模型,驗證不行 @Entity
public class Role {
@Id
private String id;
@NotEmpty
private String name;
pu