Permalink
Browse files

Merge pull request #113 from beterthanlife/master

Update CassandraType
  • Loading branch information...
nberardi committed Feb 18, 2013
2 parents 343dd5f + 7795fd2 commit b5d503267e8c87061cf691ffec80974b9b1be166
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/Types/CassandraType.cs
View
@@ -131,7 +131,24 @@ private void ParseCompositeType(string part)
_compositeTypes = new List<CassandraType>();
foreach (var p in parts)
- _compositeTypes.Add(Parse(p));
+ {
+ int reversedStart = p.IndexOf('(');
+
+ // check for reversed type
+ if (reversedStart == -1)
+ {
+ _compositeTypes.Add(Parse(p));
+ }
+ else
+ {
+ var part1 = p.Substring(0, reversedStart);
+
+ if (Parse(part1) == typeof(ReversedType))
+ _compositeTypes.Add(new CassandraType(p));
+ else
+ throw new CassandraException("Type '" + part1 + "' not found.");
+ }
+ }
}
private void ParseDynamicCompositeType(string part)

0 comments on commit b5d5032

Please sign in to comment.