Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1056

@Auditable seems not to work on eclipse indigo + java 7

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.2, 1.5.3, 1.6.0, 1.7.0
    • 7.0.0-M1
    • None
    • None
    • Oracle JDK 1.7.0_40, eclipse indigo SR2 (20120216-1857), Linux RedHat 6.4

    Description

      see http://openjpa.apache.org/builds/2.2.2/apache-openjpa/docs/ref_guide_audit.html for expected behavior

      tested against the following releases

      apache-tomee-1.5.3-20131011.041134-161-plus.tar.gz
      apache-tomee-1.6.0-20130814.041130-146-plus.zip
      apache-tomee-1.6.0-20131011.041119-202-plus.tar.gz
      apache-tomee-1.5.2-plus.tar.gz

      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>MyAuditTest>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      package ejb;

      import javax.ejb.Schedule;
      import javax.ejb.Startup;
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;

      import entities.SomePersistentEntity;

      @Stateless
      @Startup
      public class MyAuditTest {

      @PersistenceContext(unitName = "poc")
      private EntityManager entityManager;

      @Schedule(minute = "", hour = "")
      public void save()

      { System.out.println("Saving..."); SomePersistentEntity entity = new SomePersistentEntity(); entity.setS(String.valueOf(System.currentTimeMillis())); entityManager.persist(entity); }

      }

      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>SomePersistentEntity>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      package entities;

      import java.io.Serializable;

      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import javax.persistence.GenerationType;
      import javax.persistence.Id;

      import org.apache.openjpa.audit.Auditable;

      @Entity
      @Auditable
      public class SomePersistentEntity implements Serializable {

      /**
      *
      */
      private static final long serialVersionUID = 6119051520445701552L;

      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Long id;

      private String s;

      public Long getId()

      { return id; }

      public void setId(Long id)

      { this.id = id; }

      public String getS()

      { return s; }

      public void setS(String s)

      { this.s = s; }

      }

      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>persistence.xml>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
      <persistence-unit name="poc">
      <jta-data-source>poc1</jta-data-source>
      <non-jta-data-source>poc2</non-jta-data-source>
      <properties>
      <property name="openjpa.jdbc.DBDictionary" value="oracle(maxEmbeddedBlobSize=-1,maxEmbeddedClobSize=-1)"/>
      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
      <property name="openjpa.Auditor" value="default"/>
      </properties>
      </persistence-unit>
      </persistence>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shikida leonardo kenji shikida
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: