Closed xanscale closed 10 years ago
In case this would be added i would opt for a different method name, Query.all()
comes to mind. However i don't know if i feel that this is a great addition. I feel like this is easily implemented by the user of the library if this type of query is used extensively in a app. I would prefer not to add complexity to the api. I will however leave this issue open for discussion!
+1 for adding (and +1 for Query.all()
). While it's nothing but convenience, it does help when a) everything is needed and b) sorting/filtering doesn't matter.
I agree on not adding complexity to the API, but several ORMs implement something similar as a query method:
ORMLite: http://ormlite.com/javadoc/ormlite-core/com/j256/ormlite/dao/Dao.html#queryForAll()
Doctrine: https://doctrine-orm.readthedocs.org/en/latest/tutorials/getting-started.html?highlight=findAll
And I feel that One
, Many
, All
are pretty self-explanatory as to what they do.
The one caveat would be "I want all, but sorted", to which the answer would be "use Many
", IMO.
+1 for Query.all()
Actually if i need all element i need to do
Query.many(Shipment.class, "select * from Shipment")
it would be better if it was
Query.many(Shipment.class)