Tabnine Logo
me.prettyprint.hom
Code IndexAdd Tabnine to your IDE (free)

How to use me.prettyprint.hom

Best Java code snippets using me.prettyprint.hom (Showing top 20 results out of 315)

origin: hector-client/hector

private <T> void setIdIfCan(CFMappingDef<T> cfMapDef, T obj, Object pkObj)
  throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
 if (cfMapDef.getKeyDef().isComplexKey()) {
  setComplexId(cfMapDef, obj, pkObj);
 } else {
  setSimpleId(cfMapDef, obj, pkObj);
 }
}
origin: hector-client/hector

public boolean isAnyCollections() {
 if (null == getAllProperties()) {
  return false;
 }
 for (PropertyMappingDefinition md : getAllProperties()) {
  if (md.isCollectionType()) {
   return true;
  }
 }
 return false;
}
origin: hector-client/hector

public KeyDefinition getKeyDef() {
 if (null == cfBaseMapDef) {
  return keyDef;
 } else {
  return cfBaseMapDef.getKeyDef();
 }
}
origin: hector-client/hector

 @Test
 public void testCollectionWithCustomConverterPropertyHandling() {
  ClassCacheMgr cacheMgr = new ClassCacheMgr();
  CFMappingDef<CustomConvertedCollectionBean> cfMapDef = cacheMgr.initializeCacheForClass(CustomConvertedCollectionBean.class);
  
  PropertyMappingDefinition md = cfMapDef.getPropMapByPropName("mySet");
  assertEquals( null, md.getCollectionType() );
  assertEquals( "mySet", md.getColName());
  assertNotNull( "should be using slice query with custom converted collection", cfMapDef.getSliceColumnNameArr());
 }
}
origin: hector-client/hector

private byte[] generateColumnFamilyKeyFromPojo(Object obj, CFMappingDef<?> cfMapDef) {
 List<byte[]> segmentList = new ArrayList<byte[]>(cfMapDef.getKeyDef().getIdPropertyMap().size());
 for (PropertyMappingDefinition md : cfMapDef.getKeyDef().getIdPropertyMap().values()) {
  Method meth = md.getPropDesc().getReadMethod();
  segmentList.add(callMethodAndConvertToCassandraType(obj, meth, md.getConverter()));
 }
 return keyConcatStrategy.concat(segmentList);
}
origin: hector-client/hector

@Override
public EntityManagerFactory createEntityManagerFactory(final String emName, final Map map) {
 final Keyspace keyspace = keyspace((String) map.get(HOST_PROP), (String) map.get(CLUSTER_PROP), (String) map.get(KEYSPACE_PROP), (String) map.get(CONSISTENCY_PROP));
 final AnnotationScanner scanner = createScanner(value(SCANNER, map, null));
 return new EntityManagerFactoryImpl(new LightPersistenceUnitInfo((String) map.get(PACKAGES_TO_SCAN)), keyspace, scanner);
}
origin: hector-client/hector

public EntityManagerImpl(Keyspace keyspace, String[] classpathPrefix, ClassCacheMgr cacheMgr,
             HectorObjectMapper objMapper, AnnotationScanner scanner) {
 this.keyspace = keyspace;
 if (null != cacheMgr) {
  this.cacheMgr = cacheMgr;
 } else {
  this.cacheMgr = new ClassCacheMgr();
 }
 if (null != objMapper) {
  this.objMapper = objMapper;
 } else {
  this.objMapper = new HectorObjectMapper(this.cacheMgr);
 }
 initialize(scanner, classpathPrefix);
}
origin: hector-client/hector

private byte[] createBytesFromPropertyValue(Object obj, PropertyMappingDefinition md)
  throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
 Object retVal = reflectionHelper.invokeGetter(obj, md);
 // if no value, then signal with null bytes
 if (null == retVal) {
  return null;
 }
 @SuppressWarnings("unchecked")
 byte[] bytes = md.getConverter().convertObjTypeToCassType(retVal);
 return bytes;
}
origin: hector-client/hector

private <T> void processColumnAnnotation(Field f, Column anno, PropertyDescriptor pd,
  CFMappingDef<T> cfMapDef) throws InstantiationException, IllegalAccessException {
 PropertyMappingDefinition md = new PropertyMappingDefinition(pd, anno.name(),
   DefaultConverter.class);
 cfMapDef.addPropertyDefinition(md);
}
origin: hector-client/hector

public String getDiscColumn() {
 if (null == cfBaseMapDef) {
  return discColumn;
 } else {
  return cfBaseMapDef.getDiscColumn();
 }
}
origin: hector-client/hector

/**
 * Determines if the key is complex (IdClass, Embedded, etc) or a simple one field type.
 *
 * @return true if complex, false otherwise
 */
public boolean isComplexKey() {
 return null != getPkClazz();
}
origin: hector-client/hector

public EntityManagerImpl(Keyspace keyspace, EntityManagerFactory emf, Class<?>... classes) {
 this(keyspace, null, null, null);
 for (Class<?> clazz : classes) {
  cacheMgr.initializeCacheForClass(clazz);
 }
 this.emf = emf;
}
origin: hector-client/hector

public DiscriminatorType getDiscType() {
 if (null == cfBaseMapDef) {
  return discType;
 } else {
  return cfBaseMapDef.getDiscType();
 }
}
origin: hector-client/hector

public Method getAnonymousPropertyGetHandler() {
 if (null != anonymousPropertyGetHandler) {
  return anonymousPropertyGetHandler;
 } else if (null != cfSuperMapDef) {
  return cfSuperMapDef.getAnonymousPropertyGetHandler();
 } else {
  return null;
 }
}
origin: hector-client/hector

public Method getAnonymousPropertyAddHandler() {
 if (null != anonymousPropertyAddHandler) {
  return anonymousPropertyAddHandler;
 } else if (null != cfSuperMapDef) {
  return cfSuperMapDef.getAnonymousPropertyAddHandler();
 } else {
  return null;
 }
}
origin: hector-client/hector

public Class<?> getAnonymousValueType() {
 if (null != anonymousValueType) {
  return anonymousValueType;
 } else if (null != cfSuperMapDef) {
  return cfSuperMapDef.getAnonymousValueType();
 } else {
  return null;
 }
}
origin: hector-client/hector

@SuppressWarnings("rawtypes")
public Serializer getAnonymousValueSerializer() {
 if (null != anonymousValueSerializer) {
  return anonymousValueSerializer;
 } else if (null != cfSuperMapDef) {
  return cfSuperMapDef.getAnonymousValueSerializer();
 } else {
  return null;
 }
}
origin: hector-client/hector

@Override
public void refresh(Object entity, LockModeType lockMode) {
 refresh(entity);
}
origin: hector-client/hector

@Test
public void testCollectionPropertyHandling() {
 ClassCacheMgr cacheMgr = new ClassCacheMgr();
 CFMappingDef<CollectionBean> cfMapDef = cacheMgr.initializeCacheForClass(CollectionBean.class);
 
 PropertyMappingDefinition md = cfMapDef.getPropMapByPropName("mySet");
 assertEquals( Set.class, md.getCollectionType() );
 assertEquals( "mySet", md.getColName());
 assertNull( "should not be using slice query with List collection", cfMapDef.getSliceColumnNameArr());
}

origin: hector-client/hector

@Override
public EntityManagerFactory createContainerEntityManagerFactory(final PersistenceUnitInfo info, final Map map) {
 final String keyspaceName = value(KEYSPACE_PROP, map, info.getProperties());
 final String host = value(HOST_PROP, map, info.getProperties());
 final String clusterName = value(CLUSTER_PROP, map, info.getProperties());
 final String consistency = value(CONSISTENCY_PROP, map, info.getProperties());
 final Keyspace keyspace = keyspace(host, clusterName, keyspaceName, consistency);
 final AnnotationScanner scanner = createScanner(value(SCANNER, map, info.getProperties()));
 return new EntityManagerFactoryImpl(info, keyspace, scanner);
}
me.prettyprint.hom

Most used classes

  • CFMappingDef
    Holder for the mapping between a Class annotated with Entity and the Cassandra column family name.
  • ClassCacheMgr
    Manage parsing and caching of class meta-data.
  • EntityManagerImpl
    Handles entity management by scanning classpath for classes annotated with Entity and providing basi
  • HectorObjectMapper
    Maps a slice of HColumns to an object's properties. See #createObject(Object,ColumnSlice) for more d
  • KeyConcatenationDelimiterStrategyImpl
    Keys in Cassandra cannot inherently be multi-field, so a strategy must be employed to concatenate fi
  • NewBean,
  • PropertyMappingDefinition,
  • AnnotationScanner,
  • AnonymousPropertyHandling,
  • Column,
  • DefaultAnnotationScanner,
  • Id,
  • HectorObjectMapperException,
  • IdClassParserValidator,
  • InheritanceParserValidator,
  • CassandraPersistenceProvider$LightPersistenceUnitInfo,
  • CassandraPersistenceProvider,
  • CassandraTestBase,
  • CollectionMapperHelper$CollectionInfoColValue
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now