Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Java Persistence with Spring Data and Hibernate
this week in the
Spring
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
Realm primary key issue
priyanshi bhardwaj
Ranch Hand
Posts: 251
posted 2 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, I have created a realm structure. But I am getting this error :
Fatal Exception: java.lang.IllegalArgumentException: A RealmObject with no @PrimaryKey cannot be updated: class com.xxxxxxxxx.Container at io.realm.Realm.checkHasPrimaryKey(Realm.java:1729) at io.realm.Realm.copyToRealmOrUpdate(Realm.java:1090) at com.xxxxxxxxx.dao_v2.ContainerDao.lambda$createOrUpdateAll$2(ContainerDao.java:90) at com.xxxxxxxxx.-$$Lambda$ContainerDao$DmjoncgAol-86tLcwodU5QjOPfo.execute(:2) at io.realm.Realm.executeTransaction(Realm.java:1493) at com.xxxxxxxxx.ContainerDao.createOrUpdateAll(ContainerDao.java:80) at com.xxxxxxxxx.ContainerDao.createOrUpdateFromList(ContainerDao.java:74) at com.xxxxxxxxx.main.MainActivityVM$3.onResponse(MainActivityVM.java:518)
and realm structure is having a primary key
public class Container extends RealmObject { @PrimaryKey private Long id; private String name; private String status ; private Content content; // rest are getters and setters
Did anybody encounter the same problem?
Get off me! Here, read this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Problem with count() function and composed primary key
Modern Java in Action: Where to use Lambdas
Hibernate not picking values from PK
Accessor for PK Class
Question on CMP virtual persistent fields
More...