@EntityListener永远不会用wildlfy 10解雇

时间:2017-01-04 23:42:52

标签: hibernate jpa java-ee wildfly

我有一个这样的实体:

Option Explicit
Sub sample_sumpro()

Dim cal_date, nxt_date As Date

cal_date = #12/30/2016#

nxt_date = cal_date + 1

Dim name As String, ws As Sheets

name = "Kawale, Amar"

Dim dm_daily As String

With Sheets(1)
dm_daily = Application.Evaluate("SUMPRODUCT((Columns(16)=name)*Columns(4)>=cal_date)*Columns(4)<nxt_date))")
End With

MsgBox dm_daily

End Sub

听众如下:

@Entity
@EntityListeners (Rserve.class)
public class Example extends Analysis {
  private @Column @Basic int a;
  private @Column @Basic int b = 1;
  private @Column @Basic int c;
  //...
}

示例实体作为更大实体的一部分被持久化,并且它是持久化的,因为我可以在数据库中看到它,但是从不调用侦听器。我甚至都看不到聆听者的创造。我通过maven插件使用Wildfly 10。我通过public class Rserve extends Agent <R> { /* R is an annotation ... */ } public abstract class Agent <E extends Annotation> { { System.out.println ("CREATING " + getClass ().getSimpleName ()); } @PrePersist @PreUpdate @PreRemove @PostPersist @PostRemove @PostLoad @PostUpdate public void cb (Object a) { System.out.println ("CB(" + a + ")"); } }

注入EntityManager

我的persistence.xml如下所示:

@PersistenceContext

1 个答案:

答案 0 :(得分:0)

这似乎是一个Wildfly问题,没有回调实体监听器的超类。将回调放入侦听器的具体类中时,回调可以正常工作,根据Klaus Groenbaek的说法,即使在超类中,也可以在Spring Boot中正常工作。