Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/KDbPreparedStatementInterface.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 37 | /*! For implementation. Initializes the prepared statement in a backend-dependent way | |||
---|---|---|---|---|---|
42 | i.e. when attributes of the object (like WHERE field names) change. */ | 42 | i.e. when attributes of the object (like WHERE field names) change. */ | ||
43 | virtual bool prepare(const KDbEscapedString& sql) = 0; | 43 | virtual bool prepare(const KDbEscapedString& sql) = 0; | ||
44 | 44 | | |||
45 | //! For implementation, executes the prepared statement | 45 | //! For implementation, executes the prepared statement | ||
46 | //! Type of statement is specified by the @a type parameter. | 46 | //! Type of statement is specified by the @a type parameter. | ||
47 | //! @a selectFieldList specifies fields for SELECT statement. | 47 | //! @a selectFieldList specifies fields for SELECT statement. | ||
48 | //! @a insertFieldList is set to list of fields in INSERT statement. | 48 | //! @a insertFieldList is set to list of fields in INSERT statement. | ||
49 | //! Parameters @a parameters are passed to the statement, usually using binding. | 49 | //! Parameters @a parameters are passed to the statement, usually using binding. | ||
50 | //! The value pointed by @a resultOwned is set to true if the returned SQL result is owned | 50 | virtual QSharedPointer<KDbSqlResult> execute( | ||
51 | //! by the prepared statement object. This is expected and the default behaviour. | | |||
52 | //! If the value pointed by @a resultOwned is set to @c false, the KDbSqlResult object | | |||
53 | //! will be deleted by the KDbPreparedStatement object before returning. | | |||
54 | virtual KDbSqlResult* execute( | | |||
55 | KDbPreparedStatement::Type type, | 51 | KDbPreparedStatement::Type type, | ||
56 | const KDbField::List& selectFieldList, | 52 | const KDbField::List& selectFieldList, | ||
57 | KDbFieldList* insertFieldList, | 53 | KDbFieldList* insertFieldList, | ||
58 | const KDbPreparedStatementParameters& parameters, bool *resultOwned) Q_REQUIRED_RESULT = 0; | 54 | const KDbPreparedStatementParameters& parameters) Q_REQUIRED_RESULT = 0; | ||
59 | 55 | | |||
60 | friend class KDbConnection; | 56 | friend class KDbConnection; | ||
61 | friend class KDbPreparedStatement; | 57 | friend class KDbPreparedStatement; | ||
62 | private: | 58 | private: | ||
63 | Q_DISABLE_COPY(KDbPreparedStatementInterface) | 59 | Q_DISABLE_COPY(KDbPreparedStatementInterface) | ||
64 | }; | 60 | }; | ||
65 | 61 | | |||
66 | #endif | 62 | #endif |