« first day (3035 days earlier)      last day (1917 days later) » 

11:02 PM
@Ahmad I think my gf bought it, I haven't read it just yet but I remember her saying it was really interesting
 
error: (component_id) does not exist in com.mwb.digitalstorage.model.Rack
But a rack can have components, so only component must have a referrence to Rack
 
30 mins into FK_rack_id in Component, and Room gives me that look
So why is Room complaining about not having component_id in Rack? There is no such thing going on, I want a FK in Component
 
Share a gist of your 2 classes
 
11:16 PM
Inspect your table structure
 
What do you mean
I already did that
7
Q: How to create a table with a two or more foreign keys using Android Room?

JP Ventura According the entity-relationship model, the relationship between tbl_post and tbl_category could be specified using Room Persistency Library as follows: @Entity(foreignKeys = @ForeignKey( entity = TblPost.class, parentColumns = "id", childColumns = "tbl_post_id") ) class TblPostCa...

Here they are saying I missing something ,but this just seems a solution to many-to-many relation. Such is not my case
 
@MwBakker i think parentColumns should be "rack_id"
Not component_id on the FK Rack block
 
That makes sense. Looks like the relations are defined the wrong way
 
Same goes for ComponentCat.class block, you should name the parentColumns like it's named in the corresponding class, here, read this medium.com/p/bf473510c14a
 
But
"Primary keys are the parent."
"Foreign keys are the child."
 
11:29 PM
Just try what i said :D
The parent id is the id of the foreign class, like it's named there, the child id is how you name it in this class, Room needs to map your name "child id" to the real id "parent Id" otherwise it won't know what to use as ID
 
I thought the same but when I look into the docs I see samples that seem different
Or it's me being confused
0
A: Java android room two foreign key

Tariqul IslamIt seems you did not add any row two parent table like BIN.class and Order.class. I got an answer from Here

Like in here
 
Does it work?
 
Testing now
It builds, but it could bring me back to the constraint_failure and that would bring me back to the problem I started with 2 days ago
 
"it could"... What did we say about concerns?
 
alright
 
11:39 PM
Still getting that exception?
 
I just finished testing
I am back to that certain exception again
@MehdiB. I will now try this
 
Okay
 
error: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such column:
Room does not work that way as it seems
And I couldn't find it in the samples either, but what is given in the samples doesn't build either in the .gist given here in the chat
It's very strange
 
@MwBakker generally you should ignore answers by low rep users and with no votes that don't explain anything
 
I also found some today by higher reps but I can't find these SO Q's right now
To me it seems like the way I set up my FK's does not seem to have gone wrong
 
11:52 PM
Alright i need to sleep now, let's check this tomorrow (Check the medium post) and inspect your database on AS device file explorer like Tim said
 
Oh he meant inspect it on the device
Fortunatly my device is rooted, so I can do that
Sleep well, thanks for the assistence
 

« first day (3035 days earlier)      last day (1917 days later) »