Skip to content

Commit

Permalink
fixed build error
Browse files Browse the repository at this point in the history
  • Loading branch information
xamry committed Mar 15, 2013
1 parent 85f4981 commit 4717c75
Show file tree
Hide file tree
Showing 20 changed files with 126 additions and 118 deletions.
Expand Up @@ -391,19 +391,9 @@ public List<Object> findByRelation(String colName, Object colValue, Class clazz)
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;
}
Expand Down
Expand Up @@ -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;
}
Expand Down
25 changes: 0 additions & 25 deletions kundera-core/src/main/java/com/impetus/kundera/client/Client.java
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -109,22 +107,6 @@ public interface Client
*/
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);

Expand Down Expand Up @@ -198,13 +180,6 @@ Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, S
*/
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.
Expand Down
Expand Up @@ -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();
Expand Down
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down
Expand Up @@ -202,7 +202,7 @@ private Client constructClient(Class<?> clientClass)
{
try
{
client = (Client)clientClass.newInstance();
client = (Client) clientClass.newInstance();
}
catch (InstantiationException e)
{
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -235,7 +236,7 @@ protected Set<String> fetchDataFromLucene(Client client)
// 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;
}
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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()))
{
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -100,7 +101,7 @@ public List<?> getResultList()

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())
{
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -233,7 +234,7 @@ protected List<Object> setRelationEntities(List enhanceEntities, Client client,
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())
{
Expand Down Expand Up @@ -424,7 +425,7 @@ protected Set<String> fetchDataFromLucene(Client client)
// 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;
}
Expand Down
Expand Up @@ -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)
Expand Down Expand Up @@ -55,20 +52,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)
{
Expand All @@ -83,13 +66,6 @@ public List<Object> findByRelation(String colName, Object colValue, Class entity
return null;
}

@Override
public EntityReader getReader()
{
// TODO Auto-generated method stub
return null;
}

@Override
public Class<LuceneQuery> getDefaultQueryImplementor()
{
Expand Down
Expand Up @@ -54,7 +54,7 @@ protected void populateDatastoreSpecificObjects(Client client)
@Override
protected Class<?> getDefaultClientImplementation()
{
return null;
return CoreTestClient.class;
}

@Override
Expand All @@ -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();
}

/*
Expand Down

0 comments on commit 4717c75

Please sign in to comment.