Lazy Loading ORMLite + Android

0

I have an app that communicates with an online system through a Rest API, the query that the app does for the API in the case in question should follow the pattern "ClassRecoveryStatus"? "KeyCodeField"="'Key'" ...

And the loading of the entities of the app is done by ORMLite, remembering that the app is in cordova and the part of synchronization of the app is done in Java.

The problem: I need it to send as a query "SampleExample? FieldId = '99999999' & question = '3'" Since fieldId is a class that contains an ID that should be sent for the return of the data, but instead it sends only the ID the ORMLite loads the entire object and sends it in the query.

Codes: Class being synchronized contains the following attribute:

@JsonBackReference
@JsonProperty("fichaAlimentacao")
@DatabaseField(columnName = "ficha_alimentacao", uniqueCombo = true, canBeNull=false, foreign=true, maxForeignAutoRefreshLevel=2)
private SfCadastroConsumoAlimentar ficha;

Class SfCadastroConsumoFood contains the ID:

@SyncField
@JsonProperty("id")
@DatabaseField(id=true)
protected String id;

Query sent:

SfPerguntaMenos6?ficha_alimentacao='{"id":"f1071d60-6967-4bb0-841d-4c1f593132d8","outros atributos que não vem ao caso"}'&pergunta='3'

Query required:

SfPerguntaMenos6?ficha_alimentacao='f1071d60-6967-4bb0-841d-4c1f593132d8'&pergunta='3'
    
asked by anonymous 03.07.2018 / 19:44

0 answers