コード例 #1
0
 @Test
 @SuppressWarnings({"unchecked", "rawtypes"})
 public void testOverridingDifferentClassDefinedForMapping() {
   BeanPropertyRowMapper mapper = new BeanPropertyRowMapper(Person.class);
   thrown.expect(InvalidDataAccessApiUsageException.class);
   mapper.setMappedClass(Long.class);
 }
コード例 #2
0
 /**
  * Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified
  * only once).
  *
  * @param mappedClass the class that each row should be mapped to
  */
 public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass) {
   BeanPropertyRowMapper<T> newInstance = new BeanPropertyRowMapper<T>();
   newInstance.setMappedClass(mappedClass);
   return newInstance;
 }
コード例 #3
0
 @Test
 public void testOverridingSameClassDefinedForMapping() {
   BeanPropertyRowMapper<Person> mapper = new BeanPropertyRowMapper<>(Person.class);
   mapper.setMappedClass(Person.class);
 }