Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2411

Support Postgres casts for non-standard types such as inet, cidr, macaddr, etc.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2.2
    • None
    • jdbc
    • postgres 9.0
    • Patch Available

    Description

      For non-standard types (inet, cidr, macaddr) you can cast to a known Postgres type with a double colon and the type.

      Example:

      insert into click (ip) values ('127.0.0.1'::inet)

      When creating a prepared statement the placeholder marker should be '?::' instead of '?'.

      This can be fixed by overriding DBDictionary.getMarkerForInsertUpdate (patch attached) and annotating the field with the non-standard type. Like this:

      @Column(columnDefinition = "inet")

      Attachments

        1. openjpa.patch
          0.7 kB
          Eric Fenderbosch

        Activity

          People

            Unassigned Unassigned
            efenderbosch Eric Fenderbosch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: