Permalink
Browse files

fixed build error

  • Loading branch information...
1 parent 85f4981 commit 4717c7533bc8c63adc8e3dae1c262752b718481b xamry committed Mar 15, 2013
Showing with 126 additions and 118 deletions.
  1. +1 −11 kundera-cassandra/src/main/java/com/impetus/client/cassandra/pelops/PelopsClient.java
  2. +2 −8 kundera-cassandra/src/main/java/com/impetus/client/cassandra/thrift/ThriftClient.java
  3. +0 −25 kundera-core/src/main/java/com/impetus/kundera/client/Client.java
  4. +12 −6 kundera-core/src/main/java/com/impetus/kundera/client/ClientBase.java
  5. +2 −2 kundera-core/src/main/java/com/impetus/kundera/lifecycle/states/ManagedState.java
  6. +1 −1 kundera-core/src/main/java/com/impetus/kundera/loader/GenericClientFactory.java
  7. +2 −1 kundera-core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java
  8. +7 −5 kundera-core/src/main/java/com/impetus/kundera/persistence/AssociationBuilder.java
  9. +2 −1 kundera-core/src/main/java/com/impetus/kundera/query/LuceneQuery.java
  10. +3 −2 kundera-core/src/main/java/com/impetus/kundera/query/QueryImpl.java
  11. +3 −27 kundera-core/src/test/java/com/impetus/kundera/cache/ehcache/CoreTestClient.java
  12. +2 −21 kundera-core/src/test/java/com/impetus/kundera/cache/ehcache/CoreTestClientFactory.java
  13. +81 −0 kundera-core/src/test/java/com/impetus/kundera/cache/ehcache/CoreTestEntityReader.java
  14. +1 −1 kundera-hbase/src/main/java/com/impetus/client/hbase/HBaseClient.java
  15. +1 −1 kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java
  16. +1 −1 kundera-neo4j/src/main/java/com/impetus/client/neo4j/Neo4JClient.java
  17. +1 −1 kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java
  18. +2 −2 kundera-rdbms/src/main/java/com/impetus/client/rdbms/query/RDBMSEntityReader.java
  19. +1 −1 kundera-rdbms/src/main/java/com/impetus/client/rdbms/query/RDBMSQuery.java
  20. +1 −1 kundera-redis/src/main/java/com/impetus/client/redis/RedisClient.java
@@ -391,19 +391,9 @@ public List find(Class<?> entityClass, Map<String, String> embeddedColumnMap)
return entities;
}
- /*
- * (non-Javadoc)
- *
- * @see com.impetus.kundera.client.Client#getReader()
- */
- @Override
- public EntityReader getReader()
- {
- return reader;
- }
@Override
- public Class<CassQuery> getDefaultQueryImplementor()
+ public Class<?> getDefaultQueryImplementor()
{
return CassQuery.class;
}
@@ -730,15 +730,9 @@ public void deleteByColumn(String schemaName, String tableName, String columnNam
}
}
-
- @Override
- public EntityReader getReader()
- {
- return reader;
- }
-
+
@Override
- public Class<CassQuery> getDefaultQueryImplementor()
+ public Class<?> getDefaultQueryImplementor()
{
return CassQuery.class;
}
@@ -19,8 +19,6 @@
import java.util.Map;
import com.impetus.kundera.db.RelationHolder;
-import com.impetus.kundera.index.IndexManager;
-import com.impetus.kundera.persistence.EntityReader;
import com.impetus.kundera.persistence.context.jointable.JoinTableData;
/**
@@ -109,22 +107,6 @@
*/
void close();
-
-
- /**
- * Gets the persistence unit.
- *
- * @return the persistence unit
- */
- String getPersistenceUnit();
-
- /**
- * Gets the index manager.
- *
- * @return the index manager
- */
- IndexManager getIndexManager();
-
void persistJoinTable(JoinTableData joinTableData);
@@ -199,13 +181,6 @@
List<Object> findByRelation(String colName, Object colValue, Class entityClazz);
/**
- * Returns entity reader instance bind to specific client.
- *
- * @return reader entity reader.
- */
- EntityReader getReader();
-
- /**
* Returns query implementor class, required for initializing client
* specific query interface.
*
@@ -123,16 +123,22 @@ public void setFactory(ClientFactory factory)
}
- /*
- * (non-Javadoc)
- *
- * @see com.impetus.kundera.client.Client#getPersistenceUnit()
- */
+
public String getPersistenceUnit()
{
return persistenceUnit;
- }
+ }
+
+ /**
+ * @return the reader
+ */
+ public EntityReader getReader()
+ {
+ return reader;
+ }
+
+
public void deleteNode(Node node)
{
Object entity = node.getData();
@@ -73,7 +73,7 @@ public void handleRefresh(NodeStateContext nodeStateContext)
EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(nodeDataClass);
Object entityId = nodeStateContext.getEntityId();
- EntityReader reader = client.getReader();
+ EntityReader reader = ((ClientBase) client).getReader();
EnhanceEntity ee = reader.findById(entityId, entityMetadata, client);
if (ee != null && ee.getEntity() != null)
@@ -117,7 +117,7 @@ public void handleFind(NodeStateContext nodeStateContext)
Object nodeData = null; // Node data
- EntityReader reader = client.getReader();
+ EntityReader reader = ((ClientBase) client).getReader();
EnhanceEntity ee = reader.findById(entityId, entityMetadata, client);
@@ -202,7 +202,7 @@ private Client constructClient(Class<?> clientClass)
{
try
{
- client = (Client)clientClass.newInstance();
+ client = (Client) clientClass.newInstance();
}
catch (InstantiationException e)
{
@@ -29,6 +29,7 @@
import org.hibernate.proxy.HibernateProxy;
import com.impetus.kundera.client.Client;
+import com.impetus.kundera.client.ClientBase;
import com.impetus.kundera.client.EnhanceEntity;
import com.impetus.kundera.metadata.KunderaMetadataManager;
import com.impetus.kundera.metadata.MetadataUtils;
@@ -235,7 +236,7 @@ private boolean isTraversalRequired(Map<String, Object> relationsMap, ForeignKey
// use lucene to query and get Pk's only.
// go to client and get relation with values.!
// populate EnhanceEntity
- Map<String, Object> results = client.getIndexManager().search(luceneQueryFromJPAQuery);
+ Map<String, Object> results = ((ClientBase)client).getIndexManager().search(luceneQueryFromJPAQuery);
Set rSet = new HashSet(results.values());
return rSet;
}
@@ -33,10 +33,12 @@
import org.hibernate.proxy.HibernateProxy;
import com.impetus.kundera.client.Client;
+import com.impetus.kundera.client.ClientBase;
import com.impetus.kundera.client.EnhanceEntity;
import com.impetus.kundera.graph.Node;
import com.impetus.kundera.graph.ObjectGraphUtils;
import com.impetus.kundera.index.DocumentIndexer;
+import com.impetus.kundera.index.IndexManager;
import com.impetus.kundera.index.LuceneQueryUtils;
import com.impetus.kundera.lifecycle.states.ManagedState;
import com.impetus.kundera.metadata.KunderaMetadataManager;
@@ -163,7 +165,7 @@ void populateRelationViaQuery(Object entity, PersistenceDelegator pd, Object ent
// Since ID is stored at other side of the relationship, we have to
// query that table
- if (MetadataUtils.useSecondryIndex(childClient.getPersistenceUnit()))
+ if (MetadataUtils.useSecondryIndex(childMetadata.getPersistenceUnit()))
{
// Pass this entity id as a value to be searched for
associatedObjects = pd.find(childClass, entityId, relationName);
@@ -257,7 +259,7 @@ else if (traversalRequired && associatedEntities != null)
for (Object associatedEntity : associatedEntities)
{
- associatedEntity = childClient.getReader().recursivelyFindEntities(associatedEntity, null,
+ associatedEntity = ((ClientBase) childClient).getReader().recursivelyFindEntities(associatedEntity, null,
childMetadata, pd);
}
}
@@ -426,9 +428,9 @@ private List getAssociatedEntitiesFromLucene(Object entity, Object entityId, Cla
String query = LuceneQueryUtils.getQuery(DocumentIndexer.PARENT_ID_CLASS, entity.getClass().getCanonicalName()
.toLowerCase(), DocumentIndexer.PARENT_ID_FIELD, entityId, childClass.getCanonicalName().toLowerCase());
- Map<String, Object> results = childClient.getIndexManager() != null ? childClient.getIndexManager().search(
- query) : new HashMap<String, Object>();
- Set rsSet = results != null ? new HashSet (results.values()) : new HashSet();
+ IndexManager indexManager = ((ClientBase) childClient).getIndexManager();
+ Map<String, Object> results = indexManager != null ? indexManager.search(query) : new HashMap<String, Object>();
+ Set rsSet = results != null ? new HashSet(results.values()) : new HashSet();
if (childClass.equals(entity.getClass()))
{
@@ -25,6 +25,7 @@
import com.impetus.kundera.Constants;
import com.impetus.kundera.client.Client;
+import com.impetus.kundera.client.ClientBase;
import com.impetus.kundera.metadata.MetadataBuilder;
import com.impetus.kundera.metadata.model.EntityMetadata;
import com.impetus.kundera.persistence.EntityReader;
@@ -100,7 +101,7 @@ public void setLuceneQuery(String luceneQuery)
EntityMetadata m = kunderaQuery.getEntityMetadata();
Client client = persistenceDelegeator.getClient(m);
- Map<String, Object> searchFilter = client.getIndexManager().search(q, -1, maxResult);
+ Map<String, Object> searchFilter = ((ClientBase) client).getIndexManager().search(q, -1, maxResult);
if (kunderaQuery.isAliasOnly())
{
@@ -44,6 +44,7 @@
import com.impetus.kundera.Constants;
import com.impetus.kundera.client.Client;
+import com.impetus.kundera.client.ClientBase;
import com.impetus.kundera.client.EnhanceEntity;
import com.impetus.kundera.index.DocumentIndexer;
import com.impetus.kundera.metadata.KunderaMetadataManager;
@@ -233,7 +234,7 @@ public void setPersistenceDelegeator(PersistenceDelegator persistenceDelegeator)
protected List<Object> populateUsingLucene(EntityMetadata m, Client client, List<Object> result)
{
String luceneQ = getLuceneQueryFromJPAQuery();
- Map<String, Object> searchFilter = client.getIndexManager().search(luceneQ, Constants.INVALID,
+ Map<String, Object> searchFilter = ((ClientBase) client).getIndexManager().search(luceneQ, Constants.INVALID,
Constants.INVALID);
if (kunderaQuery.isAliasOnly() || !m.getType().isSuperColumnFamilyMetadata())
{
@@ -424,7 +425,7 @@ protected void transform(EntityMetadata m, List<EnhanceEntity> ls, List resultLi
// use lucene to query and get Pk's only.
// go to client and get relation with values.!
// populate EnhanceEntity
- Map<String, Object> results = client.getIndexManager().search(luceneQuery);
+ Map<String, Object> results = ((ClientBase) client).getIndexManager().search(luceneQuery);
Set rSet = new HashSet (results.values());
return rSet;
}
@@ -4,16 +4,13 @@
import java.util.Map;
import com.impetus.kundera.client.Client;
+import com.impetus.kundera.client.ClientBase;
import com.impetus.kundera.db.RelationHolder;
-import com.impetus.kundera.index.IndexManager;
-import com.impetus.kundera.persistence.EntityReader;
import com.impetus.kundera.persistence.context.jointable.JoinTableData;
import com.impetus.kundera.query.LuceneQuery;
-public class CoreTestClient implements Client
-{
-
-
+public class CoreTestClient extends ClientBase implements Client
+{
@Override
public void persist(Object entity, Object id, List<RelationHolder> rlHolders)
@@ -56,20 +53,6 @@ public void delete(Object entity, Object pKey, List<RelationHolder> rlHolders)
}
@Override
- public String getPersistenceUnit()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public IndexManager getIndexManager()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public void persistJoinTable(JoinTableData joinTableData)
{
// TODO Auto-generated method stub
@@ -84,13 +67,6 @@ public void persistJoinTable(JoinTableData joinTableData)
}
@Override
- public EntityReader getReader()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public Class<LuceneQuery> getDefaultQueryImplementor()
{
// TODO Auto-generated method stub
@@ -54,7 +54,7 @@ protected void populateDatastoreSpecificObjects(Client client)
@Override
protected Class<?> getDefaultClientImplementation()
{
- return null;
+ return CoreTestClient.class;
}
@Override
@@ -75,30 +75,11 @@ protected Object getConnectionPoolOrConnection()
return super.getConnectionPoolOrConnection();
}
- /*
- * (non-Javadoc)
- *
- * @see com.impetus.kundera.loader.ClientFactory#load(java.lang.String,
- * java.util.Map)
- */
- @Override
- public void load(String persistenceUnit, Map<String, Object> puProperties)
- {
- // TODO Auto-generated method stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.impetus.kundera.loader.GenericClientFactory#initialize(java.util.Map)
- */
@Override
public void initialize(Map<String, Object> puProperties)
{
- // TODO Auto-generated method stub
-
+ reader = new CoreTestEntityReader();
}
/*
Oops, something went wrong.

0 comments on commit 4717c75

Please sign in to comment.