Query Results To Index Unit Binding

05 Sep '14, 02:16 AM
2,796 Views
No Forum Badges

Hi everyone,

I have a problem using a query unit: I'm using it to find the nearest points to a selected location and I'm returning some oids.

I'm getting data from a table like this:

Image [oid, file (blob type - image), gpsLat, gpsLong]

The query runs fine as the oids are returned correctly. 

Now I would like to pass the oids to an index unit, in order to show the image file associated to each oid. 

I've tried to bind the output oid of the query to the key condition of the index unit but it didn't work.

I've also tried to render the images directly from the query, but it seems to be a problem related to the data type, returning the following error:

                               property 'name' not found on type java.lang.string

The query output for the file was set to 'blob' but I found out that in the descriptor the type was effectively java.lang.String, so I changed it to java.sql.Blob, but it didn't worked.

Thanks,

 

Davide

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 8

Hi,

the correct model is the one passing the oids to the Index Unit (Simple List in IFML notation).
Can you explain better what you mean with the sentence "it didn't work"?
When you model a blob attribute in the domain model, if the blob storage is file, then on the database you get a string column containing the relative path at which the file is stored. That's why you were not able to print it directly from the query unit.

Moreover, are you sure the query unit is necessary?
Is it possible to express the same query using the selector conditions on the index unit?
In this case you can avoid to execute two queries on the database.

 
x 1
No Forum Badges

I made it using the selector unit! Thank you! 

 
x 0
Answer at this question and get points!

Related questions