New test.
[mono.git] / mcs / class / System.Data / System.Data.Common / DbCommandBuilder.cs
1 //
2 // System.Data.Common.DbCommandBuilder
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2003
8 //
9
10 //
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 // 
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 // 
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 //
32
33 #if NET_2_0 || TARGET_JVM
34
35 using System.ComponentModel;
36 using System.Data;
37
38 namespace System.Data.Common {
39         public abstract class DbCommandBuilder : Component
40         {
41                 bool _setAllValues = false;
42
43                 #region Constructors
44
45                 [MonoTODO]
46                 protected DbCommandBuilder ()
47                 {
48                 }
49
50                 #endregion // Constructors
51
52                 #region Properties
53
54                 [MonoTODO]
55                 [DefaultValue (CatalogLocation.Start)]
56                 public virtual CatalogLocation CatalogLocation {
57                         get { throw new NotImplementedException (); }
58                         set { throw new NotImplementedException (); }
59                 }
60
61                 [MonoTODO]
62                 [DefaultValue (".")]
63                 public virtual string CatalogSeparator {
64                         get { throw new NotImplementedException (); }
65                         set { throw new NotImplementedException (); }
66                 }
67
68                 [MonoTODO]
69                 [DefaultValue (ConflictOption.CompareAllSearchableValues)]
70                 public virtual ConflictOption ConflictOption {
71                         get { throw new NotImplementedException (); }
72                         set { throw new NotImplementedException (); }
73                 }
74
75                 [MonoTODO]
76                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
77                 [Browsable (false)]
78                 public DbDataAdapter DataAdapter {
79                         get { throw new NotImplementedException (); }
80                         set { throw new NotImplementedException (); }
81                 }
82
83                 [MonoTODO]
84                 [DefaultValue ("")]
85                 public virtual string QuotePrefix {
86                         get { throw new NotImplementedException (); }
87                         set { throw new NotImplementedException (); }
88                 }
89
90                 [MonoTODO]
91                 [DefaultValue ("")]
92                 public virtual string QuoteSuffix {
93                         get { throw new NotImplementedException (); }
94                         set { throw new NotImplementedException (); }
95                 }
96
97                 [MonoTODO]
98                 [DefaultValue (".")]
99                 public virtual string SchemaSeparator {
100                         get { throw new NotImplementedException (); }
101                         set { throw new NotImplementedException (); }
102                 }
103
104                 [DefaultValue (false)]
105                 public bool SetAllValues {
106                         get { return _setAllValues; }
107                         set { _setAllValues = value; }
108                 }
109                 
110                 #endregion // Properties
111
112                 #region Methods
113
114                 protected abstract void ApplyParameterInfo (DbParameter parameter, 
115                                                             DataRow row, 
116                                                             StatementType statementType, 
117                                                             bool whereClause);
118
119                 [MonoTODO]
120                 protected override void Dispose (bool disposing)
121                 {
122                         throw new NotImplementedException ();
123                 }
124
125                 [MonoTODO]
126                 public DbCommand GetDeleteCommand ()
127                 {
128                         throw new NotImplementedException ();
129                 }
130
131                 [MonoTODO]
132                 public DbCommand GetDeleteCommand (bool option)
133                 {
134                         throw new NotImplementedException ();
135                 }
136
137                 [MonoTODO]
138                 public DbCommand GetInsertCommand ()
139                 {
140                         throw new NotImplementedException ();
141                 }
142
143                 [MonoTODO]
144                 public DbCommand GetInsertCommand (bool option)
145                 {
146                         throw new NotImplementedException ();
147                 }
148
149                 protected abstract string GetParameterName (int parameterOrdinal);
150                 protected abstract string GetParameterName (String parameterName);
151                 protected abstract string GetParameterPlaceholder (int parameterOrdinal);
152
153                 [MonoTODO]
154                 public DbCommand GetUpdateCommand ()
155                 {
156                         throw new NotImplementedException ();
157                 }
158
159                 [MonoTODO]
160                 public DbCommand GetUpdateCommand (bool option)
161                 {
162                         throw new NotImplementedException ();
163                 }
164
165                 [MonoTODO]
166                 protected virtual DbCommand InitializeCommand (DbCommand command)
167                 {
168                         throw new NotImplementedException ();
169                 }
170
171                 [MonoTODO]
172                 public virtual string QuoteIdentifier (string unquotedIdentifier)
173                 {
174                         throw new NotImplementedException ();
175                 }
176
177                 [MonoTODO]
178                 public virtual void RefreshSchema ()
179                 {
180                         throw new NotImplementedException ();
181                 }
182
183                 [MonoTODO]
184                 protected void RowUpdatingHandler (RowUpdatingEventArgs rowUpdatingEvent)
185                 {
186                         throw new NotImplementedException ();
187                 }
188
189                 protected abstract void SetRowUpdatingHandler (DbDataAdapter adapter);
190
191                 [MonoTODO]
192                 public virtual string UnquoteIdentifier (string quotedIdentifier)
193                 {
194                         throw new NotImplementedException ();
195                 }
196
197                 protected virtual DataTable GetSchemaTable (DbCommand cmd)
198                 {
199                         using (DbDataReader rdr = cmd.ExecuteReader ())
200                                 return rdr.GetSchemaTable ();
201                 }
202
203                 #endregion // Methods
204         }
205 }
206
207 #endif