私はプロファイルとライセンスと呼ばれるmygrailsプロジェクトに2つのクラスを持っています。クラスで重要なものの概要は次のとおりです
class Profile {
Set<Licence> licenceKeys
static hasMany = [licenceKeys:Licence]
static constraints = {
licenceKeys nullable:true
}
static mapping = {
licenceKeys cascade: 'all-delete-orphan'
}
}
class Licence {
Profile profile
String licenceKey
static belongsTo = [profile:Profile]
static constraints = {
profile nullable:false
licenceKey blank:true, nullable:true, unique:true
}
}
コントローラーの 1 つで次のコードを実行すると、
if (!profile.licenceKeys.clear()) {
log.error ("Error occured removing licence keys from the database");
userProfile.errors.each { err -> println err; }
} else {
log.info("Successfully remove licence keys from the database");
}
コンソールに次のエラー メッセージが表示され、licencekeys がデータベースに残ります
2 つの質問があります。表示されたエラー メッセージのデバッグ出力を改善することはできますか?
ありがとう