1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.ActiveRecord
.Framework
.Internal
.Tests
.Model
19 using NHibernate
.Cache
;
20 using NHibernate
.Engine
;
22 using NHibernate
.Metadata
;
23 using NHibernate
.Persister
;
24 using NHibernate
.Persister
.Entity
;
25 using NHibernate
.Type
;
27 [ActiveRecord("ClassA", Persister
=typeof(CustomPersister
))]
28 public class ClassWithCustomPersister
: ActiveRecordBase
43 [Property(Insert
=false, Update
=false)]
47 set { name1 = value; }
54 set { name2 = value; }
57 [Property(Unique
=true, NotNull
=true)]
61 set { name3 = value; }
64 [Property(ColumnType
="StringClob")]
72 public class CustomPersister
: IEntityPersister
74 public void PostInstantiate(ISessionFactoryImplementor factory
)
76 throw new NotImplementedException();
79 public void PostInstantiate()
81 throw new NotImplementedException();
84 public object CreateProxy(object id
, ISessionImplementor session
)
86 throw new NotImplementedException();
89 public bool IsUnsaved(object obj
)
91 throw new NotImplementedException();
94 public void SetPropertyValues(object obj
, object[] values
)
96 throw new NotImplementedException();
99 public object[] GetPropertyValues(object obj
)
101 throw new NotImplementedException();
104 public void SetPropertyValue(object obj
, int i
, object value)
106 throw new NotImplementedException();
109 public object GetPropertyValue(object obj
, int i
)
111 throw new NotImplementedException();
114 public object GetPropertyValue(object obj
, string name
)
116 throw new NotImplementedException();
119 public IType
GetPropertyType(string propertyName
)
121 throw new NotImplementedException();
124 public int[] FindDirty(object[] x
, object[] y
, object owner
, ISessionImplementor session
)
126 throw new NotImplementedException();
129 public int[] FindModified(object[] old
, object[] current
, object owner
, ISessionImplementor session
)
131 throw new NotImplementedException();
134 public object GetIdentifier(object obj
)
136 throw new NotImplementedException();
139 public void SetIdentifier(object obj
, object id
)
141 throw new NotImplementedException();
144 public object GetVersion(object obj
)
146 throw new NotImplementedException();
149 public object Instantiate(object id
)
151 throw new NotImplementedException();
154 public object Load(object id
, object optionalObject
, LockMode lockMode
, ISessionImplementor session
)
156 throw new NotImplementedException();
159 public void Lock(object id
, object version
, object obj
, LockMode lockMode
, ISessionImplementor session
)
161 throw new NotImplementedException();
164 public void Insert(object id
, object[] fields
, object obj
, ISessionImplementor session
)
166 throw new NotImplementedException();
169 public object Insert(object[] fields
, object obj
, ISessionImplementor session
)
171 throw new NotImplementedException();
174 public void Delete(object id
, object version
, object obj
, ISessionImplementor session
)
176 throw new NotImplementedException();
181 /// Update a persistent instance
185 ///<param name="id">The id.</param>
186 ///<param name="fields">The fields.</param>
187 ///<param name="dirtyFields">The dirty fields.</param>
188 ///<param name="hasDirtyCollection">if set to <c>true</c> [has dirty collection].</param>
189 ///<param name="oldFields">The old fields.</param>
190 ///<param name="oldVersion">The old version.</param>
191 ///<param name="obj">The obj.</param>
192 ///<param name="session">The session.</param>
193 public void Update(object id
, object[] fields
, int[] dirtyFields
, bool hasDirtyCollection
, object[] oldFields
, object oldVersion
, object obj
, ISessionImplementor session
)
195 throw new NotImplementedException();
198 public object[] GetDatabaseSnapshot(object id
, ISessionImplementor session
)
200 throw new NotImplementedException();
203 public object[] GetDatabaseSnapshot(object id
, object version
, ISessionImplementor session
)
205 throw new NotImplementedException();
208 public void Update(object id
, object[] fields
, int[] dirtyFields
, object[] oldFields
, object oldVersion
, object obj
,
209 ISessionImplementor session
)
211 throw new NotImplementedException();
214 public object[] GetCurrentPersistentState(object id
, object version
, ISessionImplementor session
)
216 throw new NotImplementedException();
219 public object GetCurrentVersion(object id
, ISessionImplementor session
)
221 throw new NotImplementedException();
224 public object ForceVersionIncrement(object id
, object currentVersion
, ISessionImplementor session
)
226 throw new NotImplementedException();
229 public bool IsUnsavedVersion(object[] values
)
231 throw new NotImplementedException();
234 public bool IsInstance(object entity
)
236 throw new NotImplementedException();
239 public void ProcessInsertGeneratedProperties(object id
, object entity
, object[] state
, ISessionImplementor session
)
241 throw new NotImplementedException();
244 public void ProcessUpdateGeneratedProperties(object id
, object entity
, object[] state
, ISessionImplementor session
)
246 throw new NotImplementedException();
249 public object IdentifierSpace
251 get { throw new NotImplementedException(); }
254 public object[] PropertySpaces
256 get { throw new NotImplementedException(); }
259 public Type MappedClass
261 get { throw new NotImplementedException(); }
264 public string ClassName
266 get { throw new NotImplementedException(); }
269 public string RootEntityName
271 get { throw new NotImplementedException(); }
274 public string EntityName
276 get { throw new NotImplementedException(); }
279 public bool ImplementsLifecycle
281 get { throw new NotImplementedException(); }
284 public bool ImplementsValidatable
286 get { throw new NotImplementedException(); }
291 get { throw new NotImplementedException(); }
294 public Type ConcreteProxyClass
296 get { throw new NotImplementedException(); }
299 public bool HasCollections
301 get { throw new NotImplementedException(); }
304 public bool HasCascades
306 get { throw new NotImplementedException(); }
309 public bool IsMutable
311 get { throw new NotImplementedException(); }
314 public bool IsIdentifierAssignedByInsert
316 get { throw new NotImplementedException(); }
319 public bool HasIdentifierProperty
321 get { throw new NotImplementedException(); }
324 public bool HasIdentifierPropertyOrEmbeddedCompositeIdentifier
326 get { throw new NotImplementedException(); }
329 public bool IsVersioned
331 get { throw new NotImplementedException(); }
334 public IVersionType VersionType
336 get { throw new NotImplementedException(); }
339 public int VersionProperty
341 get { throw new NotImplementedException(); }
344 public IIdentifierGenerator IdentifierGenerator
346 get { throw new NotImplementedException(); }
349 public IType
[] PropertyTypes
351 get { throw new NotImplementedException(); }
354 public string[] PropertyNames
356 get { throw new NotImplementedException(); }
359 public bool[] PropertyUpdateability
361 get { throw new NotImplementedException(); }
366 /// Properties that may be dirty (and thus should be dirty-checked). These
367 /// include all updatable properties and some associations.
371 public bool[] PropertyCheckability
373 get { throw new NotImplementedException(); }
376 public bool[] PropertyNullability
378 get { throw new NotImplementedException(); }
381 public bool[] PropertyInsertability
383 get { throw new NotImplementedException(); }
388 /// Get the "versionability" of the properties of this class (is the property optimistic-locked)
394 ///<c>true</c> if the property is optimistic-locked; otherwise,
398 public bool[] PropertyVersionability
400 get { throw new NotImplementedException(); }
403 public Cascades
.CascadeStyle
[] PropertyCascadeStyles
405 get { throw new NotImplementedException(); }
408 public IType IdentifierType
410 get { throw new NotImplementedException(); }
413 public string IdentifierPropertyName
415 get { throw new NotImplementedException(); }
418 public bool IsCacheInvalidationRequired
420 get { throw new NotImplementedException(); }
423 public bool IsLazyPropertiesCacheable
425 get { throw new NotImplementedException(); }
430 get { throw new NotImplementedException(); }
433 public ICacheConcurrencyStrategy Cache
435 get { throw new NotImplementedException(); }
438 public IClassMetadata ClassMetadata
440 get { throw new NotImplementedException(); }
443 public bool IsBatchLoadable
445 get { throw new NotImplementedException(); }
450 /// Returns an array of objects that identify spaces in which properties of this class are persisted,
451 /// for instances of this class and its subclasses.
455 public object[] QuerySpaces
457 get { throw new NotImplementedException(); }
460 public ISessionFactoryImplementor Factory
462 get { throw new NotImplementedException(); }
465 public bool IsVersionPropertyGenerated
467 get { throw new NotImplementedException(); }
470 public bool HasInsertGeneratedProperties
472 get { throw new NotImplementedException(); }
475 public bool HasUpdateGeneratedProperties
477 get { throw new NotImplementedException(); }
480 public bool IsSelectBeforeUpdateRequired
482 get { throw new NotImplementedException(); }