Package me.prettyprint.hom

Examples of me.prettyprint.hom.HectorObjectMapper


    slice.add("color", StringSerializer.get().toBytes(color.getName()));
    slice.add("serialProp", ObjectSerializer.get().toBytes(serialProp));
    slice.add("extra", StringSerializer.get().toBytes(extraProp));

    CFMappingDef<MyTestBean, UUID> cfMapDef = cacheMgr.getCfMapDef(MyTestBean.class, true);
    MyTestBean obj = new HectorObjectMapper(cacheMgr).createObject(cfMapDef, id, slice);

    assertEquals(id, obj.getBaseId());
    assertEquals(longProp1, obj.getLongProp1());
    assertEquals(longProp2, obj.getLongProp2());
    assertEquals(intProp1, obj.getIntProp1());
View Full Code Here


    obj.setSerialProp(new MySerial(1, 2L));
    obj.addAnonymousProp("foo", "bar");
    obj.addAnonymousProp("rice", "beans");

    Map<String, HColumn<String, byte[]>> colMap =
      new HectorObjectMapper(cacheMgr).createColumnMap(obj);
    // TODO fixme
    //assertEquals(11 + 2, colMap.size());
    assertNull("id should not have been added to column collection", colMap.get("id"));
    assertEquals(obj.getLongProp1(), (long)LongSerializer.get().fromBytes(colMap.get("lp1").getValue()));
    assertEquals(obj.getLongProp2(), LongSerializer.get().fromBytes(colMap.get("lp2").getValue()));
View Full Code Here

    ColumnSliceMockImpl slice = new ColumnSliceMockImpl();
    slice.add("lp1", LongSerializer.get().toBytes(longProp1));

    CFMappingDef<MyCustomIdBean, Colors> cfMapDef = cacheMgr.getCfMapDef(MyCustomIdBean.class, true);
    MyCustomIdBean obj = new HectorObjectMapper(cacheMgr).createObject(cfMapDef, id, slice);

    assertEquals(id, obj.getId());
    assertEquals(longProp1, obj.getLongProp1());
  }
View Full Code Here

TOP

Related Classes of me.prettyprint.hom.HectorObjectMapper

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.