private <T> void processIdAnnotation(Field f, Id anno, CFMappingDef<T> cfMapDef, Map<String, PropertyDescriptor> pdMap) throws InstantiationException, IllegalAccessException { // TODO lookup JPA 2 spec for class-level ids PropertyMappingDefinition md = new PropertyMappingDefinition(pdMap.get(f.getName()), null, DefaultConverter.class); if (null == md.getPropDesc() || null == md.getPropDesc().getReadMethod() || null == md.getPropDesc().getWriteMethod()) { throw new HectorObjectMapperException("@" + Id.class.getSimpleName() + " is defined on property, " + f.getName() + ", but its missing proper setter/getter"); } cfMapDef.getKeyDef().addIdPropertyMap(md); }
private <T> void processIdCustomAnnotation(Field f, me.prettyprint.hom.annotations.Id anno, CFMappingDef<T> cfMapDef, Map<String, PropertyDescriptor> pdMap) throws InstantiationException, IllegalAccessException { // TODO lookup JPA 2 spec for class-level ids PropertyMappingDefinition md = new PropertyMappingDefinition(pdMap.get(f.getName()), null, anno.converter()); if (null == md.getPropDesc() || null == md.getPropDesc().getReadMethod() || null == md.getPropDesc().getWriteMethod()) { throw new HectorObjectMapperException("@" + Id.class.getSimpleName() + " is defined on property, " + f.getName() + ", but its missing proper setter/getter"); } cfMapDef.getKeyDef().addIdPropertyMap(md); }