当我尝试用kundera + cassandra + eclipse映射数据时,我收到了这个错误:
Exception in thread "main" com.impetus.kundera.query.QueryHandlerException: No entity found by the name: riro
at com.impetus.kundera.query.KunderaQuery.initEntityClass(KunderaQuery.java:403)
at com.impetus.kundera.query.KunderaQuery.postParsingInit(KunderaQuery.java:339)
at com.impetus.kundera.query.QueryResolver.getQueryImplementation(QueryResolver.java:78)
at com.impetus.kundera.persistence.PersistenceDelegator.createQuery(PersistenceDelegator.java:593)
at com.impetus.kundera.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:384)
at conector.main(conector.java:34)
我的课是这样的:
import javax.persistence.Query;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class conector
{
public static void main(String[] args)
{
User user = new User();
user.setIdEquipo("009");
user.setFirstName("John");
//user.setLastName("Smith");
// user.setCity("London");
EntityManagerFactory emf = Persistence.createEntityManagerFactory("cassandra_pu");
EntityManager em = emf.createEntityManager();
Query query = (Query) em.createQuery("SELECT x FROM riro x");
em.persist(user);
em.close();
emf.close();
}
}