add support for declared cursors
Declare a cursor with the Finder::declare_cursor() method and next get the cursor with get_cursor(): morm::Cursor<MyObject> cursor = finder. declare_cursor("mycursorname"). select(). raw("ORDER BY column_name ASC"). get_cursor(); The cursor now can be used with fetch.*() methods and then get() or get_list(): MyObject myobject = cursor.fetch_next().get(); std::list<MyObject> myobjects = cursor.fetch_forward_count(10).get_list();
This commit is contained in:
@@ -78,6 +78,17 @@ public:
|
||||
|
||||
virtual void generate_rows_counter_column_name(ModelEnv & model_env, pt::TextStream & str);
|
||||
|
||||
virtual void prepare_declare_cursor_query(const pt::TextStream & cursor_name, bool scroll_cursor, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_next_query(const pt::TextStream & cursor_name, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_prior_query(const pt::TextStream & cursor_name, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_first_query(const pt::TextStream & cursor_name, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_last_query(const pt::TextStream & cursor_name, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_absotule_query(const pt::TextStream & cursor_name, long position, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_relative_query(const pt::TextStream & cursor_name, long position, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_forward_count_query(const pt::TextStream & cursor_name, size_t len, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_backward_count_query(const pt::TextStream & cursor_name, size_t len, pt::TextStream & out_stream);
|
||||
virtual void prepare_fetch_all_query(const pt::TextStream & cursor_name, pt::TextStream & out_stream);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
Reference in New Issue
Block a user