Package ma.glasnost.orika.test.community.issue26

Examples of ma.glasnost.orika.test.community.issue26.OrderData


 
    mapperFactory.getConverterFactory().registerConverter(new OrderIDConverter());
    MapperFacade facade = mapperFactory.getMapperFacade();
   
    OrderData data = new OrderData(1234l);
    Order order = facade.map(data, Order.class);
    Assert.assertEquals(new OrderID(1234l), order.getEntityID());
  }
View Full Code Here


        .field("entityID", "orderId").byDefault().toClassMap());
 
    mapperFactory.getConverterFactory().registerConverter(new OrderIDConverter());
    MapperFacade facade = mapperFactory.getMapperFacade();
   
    OrderData data = new OrderData(1234l);
    Order order = facade.map(data, Order.class);
    Assert.assertEquals(new OrderID(1234l), order.getEntityID());
  }
View Full Code Here

    }
   
    public static class OrderIdConverter extends CustomConverter<Long, OrderID> {
       
        public OrderID convert(Long source, Type<? extends OrderID> destinationType) {
            return new OrderID(source);
        }
View Full Code Here

    mapperFactory.getConverterFactory().registerConverter(new OrderIDConverter());
    MapperFacade facade = mapperFactory.getMapperFacade();
   
    OrderData data = new OrderData(1234l);
    Order order = facade.map(data, Order.class);
    Assert.assertEquals(new OrderID(1234l), order.getEntityID());
  }
View Full Code Here

   
    mapperFactory.registerClassMap(
            mapperFactory.classMap(Order.class, OrderData.class)
        .field("entityID", "orderId").byDefault().toClassMap());
 
    mapperFactory.getConverterFactory().registerConverter(new OrderIDConverter());
    MapperFacade facade = mapperFactory.getMapperFacade();
   
    OrderData data = new OrderData(1234l);
    Order order = facade.map(data, Order.class);
    Assert.assertEquals(new OrderID(1234l), order.getEntityID());
View Full Code Here

        mapperFactory.getConverterFactory().registerConverter(new OrderIdConverter());
        ClassMapBuilder<Order, OrderData> builder = ClassMapBuilder.map(Order.class, OrderData.class);
        ClassMap<Order, OrderData> classMap = builder.field("id", "number").byDefault().toClassMap();
        mapperFactory.registerClassMap(classMap);
        MapperFacade facade = mapperFactory.getMapperFacade();
        OrderData data = new OrderData(1234l);
        Order order = facade.map(data, Order.class);
        Assert.assertEquals(Long.valueOf(1234l), order.getId());
    }
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.test.community.issue26.OrderData

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.