Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-10

Cannot use @timestamp annotation on a java.sql.Timestamp field when declaring metadata for an existing Java type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • 6.0.0.Alpha9
    • None
    • None
    • None

      We have a Java class that uses java.sql.Timestamp to record time values. In Drools 5.0.1, we were able to use the @timestamp annotation as follows:

      declare StateEvent
      	@role( event )
      	@timestamp( startTime )
      	@duration( duration )
      end
      

      StateEvent contains the following:

      import java.sql.Timestamp;
      ...
          private Timestamp startTime;
          private Long duration;
          public Timestamp getStartTime() {
              return startTime;
          }
          public void setStartTime(Timestamp st) {
              startTime = st;
          }
          public Long getDuration() {
              return duration;
          }
          public void setDuration(Long d) {
              duration = d;
          }
      ....
      

      We load the rules from a .drl file as follows:

      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      kbuilder.add(ResourceFactory.newClassPathResource("path-to-file", ResourceType.DRL);
      

      In 5.4.0, this no longer works and we get the error message:

      Annotated type StateEvent - undefined property in @annotation timestamp: java.sql.Timestamp.value();
      

      Also tested with 5.5.0.Final and 5.5.0.CR1

            etirelli@redhat.com Edson Tirelli
            kw_iiinc Ken Warkentyne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: