@SuppressWarnings({"rawtypes", "unchecked"}) protected static EntityInformation createEntityInformation(Class<?> entityType) { if (Persistable.class.isAssignableFrom(entityType)) { return new PersistableEntityInformation(entityType); } return new ReflectionEntityInformation(entityType); }
@Test // DATACMNS-525 public void saveNewWithNumericId() { ReflectionEntityInformation<WithNumericId, Integer> ei = new ReflectionEntityInformation<>(WithNumericId.class); SimpleKeyValueRepository<WithNumericId, Integer> temp = new SimpleKeyValueRepository<>(ei, opsMock); WithNumericId withNumericId = new WithNumericId(); temp.save(withNumericId); verify(opsMock, times(1)).insert(eq(withNumericId)); }
@Override public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) { return new ReflectionEntityInformation<>(domainClass, Id.class); }
@SuppressWarnings("unchecked") private EntityInformation<T, ID> createEntityInformation() { Class<T> clazz = (Class<T>) GenericTypeResolver.resolveTypeArguments(getClass(), JdbcRepository.class)[0]; return new ReflectionEntityInformation(clazz); }
@Before public void setUp_After_Super_SetUp() throws Exception { ReflectionEntityInformation<Makeup, String> entityInformation = new ReflectionEntityInformation<>(Makeup.class); this.theRepository = new SimpleHazelcastRepository<>(entityInformation, keyValueOperations); }
@Before public void setUp() { ReflectionEntityInformation<Foo, String> ei = new ReflectionEntityInformation<>(Foo.class); repo = new SimpleKeyValueRepository<>(ei, opsMock); }