01: //$Id: BinaryType.java 10009 2006-06-10 03:24:05Z epbernard $
02: package org.hibernate.type;
03:
04: /**
05: * <tt>binary</tt>: A type that maps an SQL VARBINARY to a Java byte[].
06: * @author Gavin King
07: */
08: public class BinaryType extends AbstractBynaryType {
09:
10: protected Object toExternalFormat(byte[] bytes) {
11: return bytes;
12: }
13:
14: protected byte[] toInternalFormat(Object bytes) {
15: return (byte[]) bytes;
16: }
17:
18: public Class getReturnedClass() {
19: return byte[].class;
20: }
21:
22: public String getName() {
23: return "binary";
24: }
25:
26: }
|