e.setProperty("byteSet", new ShortBlob("byte set".getBytes()));
e.setProperty("byteCollection", new ShortBlob("byte collection".getBytes()));
e.setProperty("onePrimByte", 1L);
e.setProperty("oneByte", 2L);
e.setProperty("shortBlob", new ShortBlob("short blob".getBytes()));
e.setProperty("serializedPrimBytes", new Blob("serialized prim bytes".getBytes()));
e.setProperty("serializedBytes", new Blob("serialized bytes".getBytes()));
e.setProperty("serializedByteList", SS.serialize(PrimitiveArrays.asList("serialized byte list".getBytes())));
e.setProperty("serializedByteSet", SS.serialize(new HashSet<Byte>(PrimitiveArrays.asList("serialized byte set".getBytes()))));
ds.put(e);
beginTxn();
HasBytesJPA pojo = em.find(HasBytesJPA.class, e.getKey());
assertTrue(Arrays.equals("prim bytes".getBytes(), pojo.getPrimBytes()));
assertEquals(PrimitiveArrays.asList("bytes".getBytes()), Arrays.asList(pojo.getBytes()));
assertEquals(PrimitiveArrays.asList("byte list".getBytes()), pojo.getByteList());
assertEquals(new HashSet<Byte>(PrimitiveArrays.asList("byte set".getBytes())), pojo.getByteSet());
assertEquals(PrimitiveArrays.asList("byte collection".getBytes()), pojo.getByteCollection());
assertEquals(Integer.valueOf(1).byteValue(), pojo.getOnePrimByte());
assertEquals(Integer.valueOf(2).byteValue(), pojo.getOneByte().byteValue());
assertEquals(new ShortBlob("short blob".getBytes()), pojo.getShortBlob());
assertEquals(new Blob("serialized prim bytes".getBytes()), new Blob(pojo.getSerializedPrimBytes()));
assertEquals(new Blob("serialized bytes".getBytes()),
new Blob(PrimitiveArrays.toByteArray(Arrays.asList(pojo.getSerializedBytes()))));
assertEquals(PrimitiveArrays.asList("serialized byte list".getBytes()),
pojo.getSerializedByteList());
assertEquals(new HashSet<Byte>(PrimitiveArrays.asList("serialized byte set".getBytes())),
pojo.getSerializedByteSet());
commitTxn();