Permalink
Browse files

Added checks for nested reversed types in composite types

  • Loading branch information...
Adam
Adam committed Feb 8, 2013
1 parent 343dd5f commit 7795fd26973bdf31cdec947c5b9346616af9a2e1
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 7795fd2

Please sign in to comment.