Hi
Do you care putting it in a easily runnable project (mvn/ant on github/code
google for instance)?
Le 11 oct. 2013 04:22, "Leonardo K. Shikida" <shikida@gmail.com> a écrit :
> Hi
>
> I am trying to use OpenJPA @Auditable with tomee+ 1.5.2 but something
> strange is happening.
>
> persistence.xml has
>
> <property name="openjpa.Auditor" value="xxx.Auditor"/>
>
> my class xxx.Auditor
>
> public class Auditor implements org.apache.openjpa.audit.Auditor {
>
> @Override
> public void endConfiguration() {
> // TODO Auto-generated method stub
> System.out.println("works");
> }
>
> @Override
> public void setConfiguration(Configuration arg0) {
> // TODO Auto-generated method stub
> System.out.println("works");
> }
>
> @Override
> public void startConfiguration() {
> // TODO Auto-generated method stub
> System.out.println("works");
> }
>
> @Override
> public void close() throws Exception {
> // TODO Auto-generated method stub
> }
>
> @Override
> public void audit(Broker arg0, Collection<Audited> arg1,
> Collection<Audited> arg2, Collection<Audited> arg3) {
> System.out.println("?");
> System.out.println(arg1);
> System.out.println(arg2);
> System.out.println(arg3);
>
> }
>
> @Override
> public boolean isRollbackOnError() {
> // TODO Auto-generated method stub
> return false;
> }
>
> }
>
> and the auditable class
>
> @Entity
> @Auditable
> @Table(uniqueConstraints=@UniqueConstraint(columnNames={"description"}))
> public class Application implements Serializable {
> /**
> *
> */
> private static final long serialVersionUID = 6119051520445701552L;
>
> @Id
> @GeneratedValue(strategy = GenerationType.AUTO)
> private Long id;
>
> (...)
>
>
> I am deleting/inserting/editing the Application class but it seems the
> audit() method is not being called, while endConfiguration(),
> setConfiguration(), and startConfiguration() are.
>
> I am running from inside eclipse, no stacktrace detected. Entity classes
> are being enhanced on build.
>
> TIA
>
> Leo
>
|