Hi Isomorphic,
Thanks for your detailed response. My problem is not the data and not the fetch and add operations (these are solved already), it is the criteria in update operations that is making trouble whenever it contains the id.
What happens:
The id criteria (e.g. id=”1234567890123456) is of type text, so in order for this to work, I need to either
Option 1: convert the criteria to long (DMI). This is not possible (as reported) because it is back converted to text due to the type of the id field (which is text). See
Option 2: do the update operation using an alias field of type text (stringId). Two suboptions
Option 2.1: remove the id field form the DS. Then I get
Option 2.2: let the id field in place
What happens: I get both, id and stringID in the criteria. Because id is not accurate (crippled long version), I need to remove it from the critiera (DMI), which then leads to the same error as above.
I don’t know whether both “issues” are by design, but they clearly derail my text field approach.
I tried this as well i.e.
But this id is crippled too.
Yeah, I missed that.
Postgres on the server, but the ids are by design. They are generated using a hash of the content of a second binary field. 64-bit hashes are just considered ok, less would become more and more problematic (collisions). These records are generated and used on mobile Android devices whose SQL-APIs (CursorAdapter) need an id field of type long.
Hope things are clear now,
Thanks,
fatzopilot
Thanks for your detailed response. My problem is not the data and not the fetch and add operations (these are solved already), it is the criteria in update operations that is making trouble whenever it contains the id.
What happens:
The id criteria (e.g. id=”1234567890123456) is of type text, so in order for this to work, I need to either
Option 1: convert the criteria to long (DMI). This is not possible (as reported) because it is back converted to text due to the type of the id field (which is text). See
Originally posted by Isomorphic
View Post
Option 2.1: remove the id field form the DS. Then I get
Code:
com.isomorphic.base.UpdateWithoutPKException: Criteria received from the client for update operation is missing the following required unique and/or primary fields: [id]
What happens: I get both, id and stringID in the criteria. Because id is not accurate (crippled long version), I need to remove it from the critiera (DMI), which then leads to the same error as above.
I don’t know whether both “issues” are by design, but they clearly derail my text field approach.
Originally posted by Isomorphic
View Post
Code:
<field name="stringId" type="text" title="IdString" valueXPath="id" primaryKey="true"/>
Originally posted by Isomorphic
View Post
Originally posted by Isomorphic
View Post
Hope things are clear now,
Thanks,
fatzopilot
Comment