Package com.impetus.kundera.property.accessor

Examples of com.impetus.kundera.property.accessor.UUIDAccessor


       
        List<byte[]> listAsBytes= new ArrayList<byte[]>();
       
        UUID randomId = UUID.randomUUID();
        listAsBytes.add("Vivek".getBytes());
        listAsBytes.add(new UUIDAccessor().toBytes(randomId));
       
        result.setListAsBytes(listAsBytes);
        em.merge(result); // merge with list as bytes.
       
        em.clear()// clear from cache.
       
        result = em.find(CollectionEntity.class, "entityId1");
        Assert.assertNotNull(result);
        assertOnList(result, randomId);       
       
        Set<byte[]> setAsBytes = new HashSet<byte[]>();
        setAsBytes.add("Vivek".getBytes());
        setAsBytes.add(new UUIDAccessor().toBytes(randomId));
        result.setSetAsBytes(setAsBytes);
        em.merge(result); // merge with list as bytes.
       
        em.clear();
        result = em.find(CollectionEntity.class, "entityId1");
View Full Code Here


        {
            String str = (String) PropertyAccessorHelper.getObject(String.class, recInBytes);
           
            if(!str.equals("Vivek")) // string record is already compared
            {
                UUIDAccessor uuidAccessor = new UUIDAccessor();
                UUID recAsUUID = uuidAccessor.fromBytes(UUID.class, recInBytes);
                Assert.assertEquals(randomId, recAsUUID);
               
            }
        }
        catch (Exception e)
View Full Code Here

       
        List<byte[]> listAsBytes= new ArrayList<byte[]>();
       
        UUID randomId = UUID.randomUUID();
        listAsBytes.add("Vivek".getBytes());
        listAsBytes.add(new UUIDAccessor().toBytes(randomId));
       
        result.setListAsBytes(listAsBytes);
        em.merge(result); // merge with list as bytes.
       
        em.clear()// clear from cache.
       
        result = em.find(EntityWithCollection.class, "entityId1");
        Assert.assertNotNull(result);
        assertOnList(result, randomId);       
       
        Set<byte[]> setAsBytes = new HashSet<byte[]>();
        setAsBytes.add("Vivek".getBytes());
        setAsBytes.add(new UUIDAccessor().toBytes(randomId));
        result.setSetAsBytes(setAsBytes);
        em.merge(result); // merge with list as bytes.
       
        em.clear();
        result = em.find(EntityWithCollection.class, "entityId1");
View Full Code Here

        {
            String str = (String) PropertyAccessorHelper.getObject(String.class, recInBytes);
           
            if(!str.equals("Vivek")) // string record is already compared
            {
                UUIDAccessor uuidAccessor = new UUIDAccessor();
                UUID recAsUUID = uuidAccessor.fromBytes(UUID.class, recInBytes);
                Assert.assertEquals(randomId, recAsUUID);
               
            }
        }
        catch (Exception e)
View Full Code Here

TOP

Related Classes of com.impetus.kundera.property.accessor.UUIDAccessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.