Initializing a transient attribute of a JPA entity during CriteriaQuery

后端 未结 2 468
不思量自难忘°
不思量自难忘° 2021-01-04 11:36

I\'m wondering if it is possible to initialize a transient attribute of an entity during a criteria query.

Example

@Entity
public SampleEntity{

  @         


        
2条回答
  •  鱼传尺愫
    2021-01-04 12:17

    You can also initialize your transients in the default (i.e., no argument) constructor.

    You can see that this is the strategy used, for example, in EclipseLink (read last comment in the following link):

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=292385

提交回复
热议问题