Query - getOptions - why is it package protected, should it be public?

15 views
Skip to first unread message

nmaya...@ebay.com

unread,
Sep 15, 2017, 3:10:05 PM9/15/17
to Morphia
We have a library which takes in Query as the input parameter.

1. In the application, they set following on query object

query.order(sortyBy)

2. Library gets the query object and internally based on configuration needs to set
    maxTime
    readPreference

    Query itself does not have setters for this, which means have to create new options object in step 2 and the values set in step 1 is lost. 

Instead if i get the options from step 1 and then add other options in step 2, that would work.

But how do i get the options from query object?

Thanks in advance.

Maya

unread,
Sep 15, 2017, 5:05:19 PM9/15/17
to Morphia
When methods which take options as a parameter get called ( such as public List<T> asList(final FindOptions options) { )
shouldn't it merge the options already set in its private member variable with the method parameter options
Or
provide a getter to access options member variable
Reply all
Reply to author
Forward
0 new messages