Mercurial > hg > monetdb-java
view src/main/java/nl/cwi/monetdb/embedded/mapping/MonetDBEmbeddedBlob.java @ 51:c592d8a72627 embedded
More defensive approach for tables. Only the table name and schema are cached.
author | Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> |
---|---|
date | Wed, 16 Nov 2016 21:21:26 +0100 (2016-11-16) |
parents | 2ab2b21cf930 |
children | 5f12b8a08204 |
line wrap: on
line source
package nl.cwi.monetdb.embedded.mapping; import java.io.Serializable; import java.util.Arrays; /** * A Java representation for the BLOB data type. Added for more efficient data mapping when fetching from the database. * * @author <a href="mailto:pedro.ferreira@monetdbsolutions.com">Pedro Ferreira</a> */ public class MonetDBEmbeddedBlob implements Serializable { /** * The BLOB's content as a Java byte array. */ private final byte[] blob; public MonetDBEmbeddedBlob(byte[] blob) { this.blob = blob; } /** * Get the BLOB content itself, * * @return A Java byte array containing the BLOB itself */ public byte[] getBlob() { return this.blob; } /** * Overriding the equals method for the byte array. */ @Override public boolean equals(Object obj) { return obj instanceof MonetDBEmbeddedBlob && Arrays.equals(this.blob, ((MonetDBEmbeddedBlob) obj).getBlob()); } /** * Overriding the hashCode method for the byte array. */ @Override public int hashCode() { return Arrays.hashCode(this.blob); } /** * Overriding the toString method for the byte array. */ @Override public String toString() { return Arrays.toString(blob); } }