English 中文(简体)
Java, Hibernate Note, • 如何为日本国际协力事业团添加方法?
原标题:Java, Hibernate annotations, How to add methods to POJO object?

我正在使用温和的说明。 • 如何为日本国际协力事业团添加方法? 例如,i有与数据库有关的“儿童指标”方法,但希望也采用“儿童指标”补充方法。 我获得“org.hibernate.Property NotFoundException: 如果是的话,就找不到一套用于“类别”例外情况下的财产进展。

最佳回答

如果我将此解释为“我是否添加了一种与持久性有关的NOT方法”,那么你需要使用@transient annotation on the getAllChildNodes(

问题回答

界定贵实体结构有两个途径。

  • using annotations on the instance variables of your entity or
  • using annotations on the getter methods of your entity

在使用“采集方法”的说明时,Hibernate假设,每 getxxx(和Boolean型异构体的xxx)都代表了持久性财产的定义。 即便这一具体内容不包含任何说明,也属于这种情况。

解放者还期望为每一种持久性财产找到一种配套的固定方法。 而就你的情况而言,是遗漏的,造成例外。

你可以解决这个问题,宣布你的习俗为@transient<>/code>,即:这并不意味着一种持久性财产。 另一种方式是将实体转换成对实例变量的说明。 后者将是我的个人选择。

打开java案卷,并写出一个名为get AllChildNodes(的方法。

自愿者不给你写密码,在你的数据库中绘制田地图。 所有这一切都是如此。 如果你想在贵国的域/模范课堂中除为您的财产提供正常的接收器和固定装置外,还要有额外的逻辑,那么你就不得不补充。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...