VARBINARY should map to byte[] under H2

Bug #798958 reported by cowwoc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

2.2.0-beta4 maps VARBINARY to BLOB, but under H2 VARBINARY should actually map to byte[]. See http://www.h2database.com/html/datatypes.html#binary_type

Revision history for this message
cowwoc (gili) wrote :

On second thought, I don't necessarily mind the usage of BLOB. It has the benefit of providing a consistent interface to binary data across all databases. simply invoked:

byte[] data = blob.getBytes(0, (int) blob.length());

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

According to the docs, Blob is valid as well. You can override the default mappings in Querydsl SQL.

Changed in querydsl:
status: New → Opinion
Revision history for this message
cowwoc (gili) wrote :

According to which docs (can you provide a link)?

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Sorry, I misread. I mixed the SQL type BLOB with the Java type Blob. You are right about this.

Changed in querydsl:
status: Opinion → In Progress
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Fixed in SVN trunk :

        // byte[]
        registerDefault(Types.BINARY, byte[].class);
        registerDefault(Types.LONGVARBINARY, byte[].class);
        registerDefault(Types.VARBINARY, byte[].class);

        // BLOB
        registerDefault(Types.BLOB, Blob.class);

Changed in querydsl:
status: In Progress → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.2.0.beta5

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.