0
我試圖使用帶有BLOB數據類型的擴展GenericModel,但我得到的錯誤:玩!與BLOB數據類型的通用模型衝突
Execution error occured in template
{module:crud}/app/views/tags/crud/form.html. Exception raised was
MissingPropertyException : No such property: id for class: models.Member.
In {module:crud}/app/views/tags/crud/form.html (around line 56)
#{crud.passwordField name:field.name, value:(currentObject ? currentObject[field.name] : null) /}
#{/if}
#{if field.type == 'binary'}
#{crud.fileField name:field.name, value:(currentObject ? currentObject[field.name] : null), id:currentObject?.id /}
#{/if}
#{if field.type == 'longtext'}
#{crud.longtextField name:field.name, value:(currentObject ? currentObject[field.name] : null) /}
#{/if}
我的模式是:
@Entity
@Table(name = "news_feed")
public class NewsFeed extends GenericModel {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long news_id;
public Blob news_image;
...
}
我不如果我刪除extends GenericModel
或者如果我刪除blob,則會出現錯誤。是什麼導致了這個問題?
歡迎任何幫助。
謝謝!
是不是這應該由'@ Id'解決?它雖然工作,但謝謝! – Luke
@Id將您的屬性設置爲jpa持久性的標識,但CRUD模塊適用於比jpa更嚴格的約定 –