Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    BUG? JPADataSource picks up static final fields in schemaBean

    I had to mark my public static final fields as @Transient, otherwise JPADataSource produces datasource fields for them.

    Seems weird and like it's a bug.

    #2
    Thanks for spotting.

    Fixed.

    Now DSField will not be generated for field (or method) with any of theses modifiers: static, final, transient.

    Should be available in next nightly build.

    Regards,
    Alius.

    Comment


      #3
      cool, thanks.

      maybe this is a stupid question, but why does JPADataSource differ so much from the standard schemaBean behaviour where it only creates DSFields for the get/set exposed methods?

      Comment


        #4
        I'm not sure what do you mean by standard... Anyway...

        In JPA you can annotate either fields or methods. Implementation checks it and uses accordingly. Other "difference": it strives to acquire as much information as possible about field to make DSField configuration as full as possible. You can always overwrite any setting in case you need it.

        Regards,
        Alius

        Comment


          #5
          Sorry, by standard I meant BasicDatasource - which sticks to get/set methods only.

          But yes, I can see why the field method is useful. It just took me by surprise. I figured out what it was doing by looking at the DataSourceLoader result (it was quite confusing for a bit since I had a Long id and a private static final String ID="id" in my class)

          My main suggestion is to update the docs to make it more clear what schemabean does for each type of DataSource.

          Comment

          Working...
          X