Norbert Sándor wrote:
Sorry, I don't fully understand...
If I understand the new API well, my query in the implementation of getValues() should return a list of full hibernate objects in my case. I don't see how can I still query only the ID and the label - although today was a long day :)

So your are also in europe?

Currently, a list of objects is returned from the model, for each one getPK and getLabel is called.
It doesn't really mutter if the objects are the same as the value or not.

The same getLabel and getPK are also called with the Value of the Autocompleter, so you can still use a list of Object[] in your filter method, but you habe to check beforehand what is given, the value (entity) or an Object[]...

Better?
Cheers,
Ron



Regards:
Norbi

Ron Piterman írta:

I think you get a List<Object[]> from hibernate?
you can change your model to extract object[0] as key, object[1] as value, and return the whole object for getForPrimaryKey( key ) - ( I think its another method signature- but the same meaning)...
Cheers,
Ron

Norbert Sándor wrote:

Hello,

Unfortunatelly I've not followed the discussion about the subject.
As the new doc says for IAutocompleteModel.getValues():

* Expected to return a list of all possible values, filtering out values that * match the specified String in the <strong>label</strong> representation of the value.

Sorry for the late reaction but I think the previous version was better. I explain why.
In my application I use Autocompleter to list Hibernate objects.
Until this modification my query was:

   SELECT o.id,o.text FROM ... WHERE filter condition

but now I have to write

   SELECT o FROM ... WHERE filter condition

so the query must return full objects, it may require much more DB bandwidth.
I see that Autocompleter's implementation is now very clean

           key = model.getPrimaryKey(value);
           label = model.getLabelFor(value);

but it may have negative performance impact in case of more complex applications.

Sorry if I misunderstood something...

Regards:
Norbi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to