diff options
author | lbsa71 | 2008-01-14 22:34:19 +0000 |
---|---|---|
committer | lbsa71 | 2008-01-14 22:34:19 +0000 |
commit | 6d751411b7f996c486052c8cbbdbe1e186cebd9f (patch) | |
tree | eb7a0a101695e85cefb3a8f0ed540d402caedc63 /ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs | |
parent | my Exists check was slow and wrong. This fixes issues people (diff) | |
download | opensim-SC-6d751411b7f996c486052c8cbbdbe1e186cebd9f.zip opensim-SC-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.gz opensim-SC-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.bz2 opensim-SC-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.xz |
* Added specialization of DatabaseMapper, DataReader and ObjectFieldMapper to support LLVector3, LLQuaternion and LLUUID
* Added PrimitiveBaseShapeTableMapper to show how it's done
NOTE: Nothing actually works yet - this code should be considered more of educational value until it's all wired together
Diffstat (limited to '')
-rw-r--r-- | ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs index 0b9d16d..63e59aa 100644 --- a/ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs +++ b/ThirdParty/TribalMedia/TribalMedia.Framework.Data/DatabaseMapper.cs | |||
@@ -41,7 +41,6 @@ namespace TribalMedia.Framework.Data | |||
41 | } | 41 | } |
42 | 42 | ||
43 | public abstract DbConnection GetNewConnection(); | 43 | public abstract DbConnection GetNewConnection(); |
44 | |||
45 | public abstract string CreateParamName(string fieldName); | 44 | public abstract string CreateParamName(string fieldName); |
46 | 45 | ||
47 | public DbCommand CreateSelectCommand(TableMapper mapper, DbConnection connection, string fieldName, object key) | 46 | public DbCommand CreateSelectCommand(TableMapper mapper, DbConnection connection, string fieldName, object key) |
@@ -67,7 +66,7 @@ namespace TribalMedia.Framework.Data | |||
67 | 66 | ||
68 | DbParameter param = command.CreateParameter(); | 67 | DbParameter param = command.CreateParameter(); |
69 | param.ParameterName = keyFieldParamName; | 68 | param.ParameterName = keyFieldParamName; |
70 | param.Value = FieldMapper.ConvertToDbType(key); | 69 | param.Value = ConvertToDbType(key); |
71 | command.Parameters.Add(param); | 70 | command.Parameters.Add(param); |
72 | 71 | ||
73 | return String.Format("{0}={1}", fieldName, keyFieldParamName); | 72 | return String.Format("{0}={1}", fieldName, keyFieldParamName); |
@@ -131,5 +130,10 @@ namespace TribalMedia.Framework.Data | |||
131 | 130 | ||
132 | return command; | 131 | return command; |
133 | } | 132 | } |
133 | |||
134 | public virtual object ConvertToDbType(object value) | ||
135 | { | ||
136 | return value; | ||
137 | } | ||
134 | } | 138 | } |
135 | } \ No newline at end of file | 139 | } \ No newline at end of file |