Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 82 lines (69 sloc) 2.194 kb
1cf7cf7 @nberardi added support for removal inserting, removing by key, and removing a …
nberardi authored
1 using System;
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
2 using System.Linq;
ab0995d @nberardi laying framework for poco support
nberardi authored
3 using FluentCassandra.ObjectSerializer;
2db6327 @nberardi going through some changes to make the interface the objects more use…
nberardi authored
4 using FluentCassandra.Types;
1cf7cf7 @nberardi added support for removal inserting, removing by key, and removing a …
nberardi authored
5
6 namespace FluentCassandra
7 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
8 [Obsolete("Use \"CassandraColumnFamily\" class with out generic type")]
9 public class CassandraColumnFamily<CompareWith> : CassandraColumnFamily
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored
10 where CompareWith : CassandraObject
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
11 {
12 public CassandraColumnFamily(CassandraContext context, string columnFamily)
13 : base(context, columnFamily)
14 {
15 SetSchema(new CassandraColumnFamilySchema {
16 FamilyName = columnFamily,
17 ColumnNameType = typeof(CompareWith)
18 });
19 }
20 }
21
e1b11ad @nberardi [breaking change] with recent changes in the Cassandra API and the ne…
nberardi authored
22 public partial class CassandraColumnFamily : BaseCassandraColumnFamily
1cf7cf7 @nberardi added support for removal inserting, removing by key, and removing a …
nberardi authored
23 {
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
24 private CassandraColumnFamilySchema _cachedSchema;
1d0ca56 @nberardi CQL generation tests are passing
nberardi authored
25 private ObjectSerializerConventions _conventions;
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
26
222aa24 @nberardi connections can now failover, pool, and load balance
nberardi authored
27 public CassandraColumnFamily(CassandraContext context, string columnFamily)
ab0995d @nberardi laying framework for poco support
nberardi authored
28 : base(context, columnFamily)
862aa3c @gillotte Allow for family column cache sharing between context/keyspace/column…
gillotte authored
29 {
1d0ca56 @nberardi CQL generation tests are passing
nberardi authored
30 _conventions = new ObjectSerializerConventions();
ab0995d @nberardi laying framework for poco support
nberardi authored
31 }
2db6327 @nberardi going through some changes to make the interface the objects more use…
nberardi authored
32
862aa3c @gillotte Allow for family column cache sharing between context/keyspace/column…
gillotte authored
33 public CassandraColumnFamily(CassandraContext context, CassandraColumnFamilySchema schema)
34 : base(context, schema.FamilyName)
35 {
36 _cachedSchema = schema;
37 _conventions = new ObjectSerializerConventions();
38 }
39
d576460 @nberardi made the type system more robus to support parsing of complex types f…
nberardi authored
40 public FluentColumnFamily CreateRecord(CassandraObject key)
1cf7cf7 @nberardi added support for removal inserting, removing by key, and removing a …
nberardi authored
41 {
b9d2f58 @nberardi all tests pass after most recent changes
nberardi authored
42 if (key.GetValue<byte[]>().Length == 0)
5a77142 @nberardi fix for issue #12 relating to check if BytesType is 0 length on creat…
nberardi authored
43 throw new ArgumentException("'key' is not allowed to be zero length.", "key");
44
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
45 return new FluentColumnFamily(key, FamilyName, GetSchema());
46 }
47
1d0ca56 @nberardi CQL generation tests are passing
nberardi authored
48 public ObjectSerializerConventions ObjectConventions
49 {
50 get { return _conventions; }
51 set
52 {
53 if (value == null)
54 throw new ArgumentNullException("value");
55
56 _conventions = value;
57 }
58 }
ab0995d @nberardi laying framework for poco support
nberardi authored
59
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
60 public override CassandraColumnFamilySchema GetSchema()
61 {
4526a65 @nberardi some much needed refactoring of the schema
nberardi authored
62 var schema = Context.Keyspace.GetColumnFamilySchema(FamilyName);
10617e5 @nberardi all tests now pass
nberardi authored
63
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
64 if (_cachedSchema == null)
4526a65 @nberardi some much needed refactoring of the schema
nberardi authored
65 _cachedSchema = (schema == null)
66 ? new CassandraColumnFamilySchema(FamilyName, ColumnType.Standard)
67 : schema;
2f86912 @nberardi all tests now compile, so the new genericless types have been provide…
nberardi authored
68
69 return _cachedSchema;
70 }
71
72 public override void SetSchema(CassandraColumnFamilySchema schema)
73 {
74 _cachedSchema = schema;
75 }
76
77 public override void ClearCachedColumnFamilySchema()
78 {
79 _cachedSchema = null;
88be638 @nberardi did some clean up and Get is now supported for a single column
nberardi authored
80 }
1cf7cf7 @nberardi added support for removal inserting, removing by key, and removing a …
nberardi authored
81 }
acbb5c3 @nberardi update TimeUUID to get back the DateTime from the UUID that is generated
nberardi authored
82 }
Something went wrong with that request. Please try again.