attribute of the given name and type is not present in the managed type, for name error from kundera created CF

467 views
Skip to first unread message

subash b

unread,
Jan 10, 2014, 10:53:17 PM1/10/14
to kundera...@googlegroups.com
 
Team,

1. Though data is available in cassandra DB, i am receiving attribute of the given name and type is not present in the managed type, for name:EMP_ID error from kundera AbstractManagedType.java. attached cqlsh, TC, PU and trace details and my entities are using @IndexCollection

 

2. Kundera will default PK column name as "key" during CF creation. In my entity class, defined PK name is EMP_ID. Still Can I access data using PK name as EMP_ID using namedQuery? Not able to access data using EMP_ID in cqlsh. select * from "EMPLOYEE" where "EMP_ID" = 1 says no undefined EMP_ID name but i can able to access data using "key" (select * from "EMPLOYEE" where "key" = 1)

 

3. Can you plz share some Cache example projects if any from github.

 
 
Thanks.

 


question.zip

Vivek Mishra

unread,
Jan 11, 2014, 12:59:58 AM1/11/14
to kundera...@googlegroups.com
Please try with these changes. You need to refer attributes in place of jpa column name.

@Entity
@Table(name = "DEPARTMENT")
@IndexCollection(columns = { @Index(name = "deptName"),
@Index(name = "deptCode") })
@NamedQueries({
@NamedQuery(name = "retrieveDepartment", query = "select d from Department d where d.deptName = ?1"),
@NamedQuery(name = "findDeptById", query = "select d from Department d where d.deptId = ?1") })
public class Department {


///////////////////////////////////////////////////
@Entity
@Table(name = "EMPLOYEE")
@IndexCollection(columns = { @Index(name = "employeeName"),
@Index(name = "designation"), @Index(name = "experience"),
@Index(name = "currentProject") })
@NamedQueries({
@NamedQuery(name = "retrieveEmployee", query = "select e from Employee e where e.employeeName = ?1"),
@NamedQuery(name = "findEmployeeById", query = "select e from Employee e where e.employeeId = ?1") })
public class Employee {



-Vivek
________________________________________
From: kundera...@googlegroups.com [kundera...@googlegroups.com] on behalf of subash b [dumm...@gmail.com]
Sent: 11 January 2014 09:23
To: kundera...@googlegroups.com
Subject: {kundera-discuss} attribute of the given name and type is not present in the managed type, for name error from kundera created CF
--
You received this message because you are subscribed to the Google Groups "kundera-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kundera-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

________________________________






NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

subash b

unread,
Jan 13, 2014, 7:53:21 PM1/13/14
to kundera...@googlegroups.com
 
Thanks Vivek. It worked.


Reply all
Reply to author
Forward
0 new messages