How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties?
for example: in my case i would like to get object and just moment before update/insert db
add to that object some additional information (like user id or computer name) by using IInterc...
How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties?
for example: in my case i would like to get object and just moment before update/insert db add to that object some additional information (like user id or computer name) by using IInterce...
Hi There!
Right now I'm having a problem with Unity InterfaceInterceptor because it will fail when constructing the dynamic type. My classes and interfaces are something like this:
public interface IService<T>
{
void Save(T entity);
}
public interface IOrderService : IService<Order>
{
void GetCustomerOrders(Customer custome...
Why does the following not intercept calls to IBusinessService with the LogAspect?
container.Register(AllTypes.Of<IBusinessService>()
.FromAssembly(Assembly.GetExecutingAssembly())
.ConfigureFor<BusinessService>(
c => c.Named(typeof(BusinessService).Name)
.Interceptors(InterceptorReference.ForType<LogAspect>(...
I'm trying to save a mapped entity using NHibernate but my insert to the database fails because the underlying table has a column that does not allow nulls and IS NOT mapped in my domain object. The reason it isn't mapped is because the column in question supports a legacy application and has no relevance to my application - so I'd like ...
I'm using Castle DynamicProxy2 to "tack on" interfaces to retrieve fields from a dictionary. For example, given the following class:
public class DataContainer : IDataContainer
{
private Dictionary<string, object> _Fields = null;
public Dictionary<string, object> Data
{
get { return _Fields ?? (_Fields = new Dictio...
Hello,
I am having a problem loading objects using NHibernate. These entities have reference to files which no longer exist. When NHibernate assigns the 'Path' property of these entities these entities try to load the file which results in a an exception. The exception causes the loading transaction to roll-back completely.
I would lik...
I'm trying to get an interceptor I've written to work, but for some reason it doesn't seem to be instantiating the interceptor when I request my components. I'm doing something like this (forgive me if this doesn't quite compile, but you should get the idea):
container.Register(
Component.For<MyInterceptor>().LifeStyle.Transient,
...
I have an application that was working fine that uses Windsor for IoC. I want to log the method calls, parameters, and execution time of all calls made to components instantiated by Windsor, so I implemented a LoggingInterceptor that implements IInterceptor, that contains:
Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
...
I created a simple AuditInterceptor: EmptyInterceptor now I wonder how can I register this new interceptor with my application using Windsor?
...
Hello,
I set up an IInterceptor for ILoggable objects in my domain model. And on OnFlushDirty event, i am trying to save a log (audit). But while doing this, my code goes into an infinite loop.
_logrepository.Save(log) calls OnFlushDirty even if log is not an ILoggable object (it is because entity is still the previous object)
Is the...
My domain objects support custom fields that are stored in such a way that requires metadata and logic to be applied before their values can be stored and retrieved.
I already have a Custom Field Repository that handles the persistence of custom fields, and I don't want to try to recreate that logic in NHibernate mappings.
I would ho...
I am trying to implement nhibernate transaction handling through Interceptors and couldn’t figure out how to register the interface through fluent mechanism.
I see a
Component.For<ServicesInterceptor>().Interceptors
but not sure how to use it. Can someone help me out? This example seemed a little complex.
...
This is the first time I've used interceptors with the fluent registration and I'm missing something. With the following registration, I can resolve an IProcessingStep, and it's a proxy class and the interceptor is in the __interceptors array, but for some reason, the interceptor is not called. Any ideas what I'm missing?
Thanks,
Drew...
Does anyone have a suggestion on a better way to intercept a properties with Castle DynamicProxy? Specifcally, I need the PropertyInfo that I'm intercepting, but it's not directly on the IInvocation, so what I do is:
public static PropertyInfo GetProperty(this MethodInfo method)
{
bool takesArg = method.GetParameters...
I have an application that uses NHibrenate and I'm using an interceptor based solution for logging/auditing.
Basically I have a class inheriting from EmptyInterceptor and overriding OnFlushDirty, OnSave and OnDelete.
Everything works perfectly - except - when I add or remove from a set or list that is mapped using many-to-many without ...
Hi, I am using struts2.1.6 + Spring 2.5 I have four modules in my application.
Registration Module
Admin Module
Quote Module
Location Module.
In registration module the customer can register himself and only after registering he is supposed to have access of the remaining three modules.
I want to implement something like if the acti...
I'm using NHibernate and Dynamic Proxy. I have one table (Customer) with generic fields: charField1, charField2, etc. One record in this table may represent company A while another record may represent company B. However, a different domain model will exist for company A's data than company B's data because they require different informa...
Based on the documentation for Castle.Core.InterceptorAttribute, I am trying to make this simple test pass, and am having no luck:
using NUnit.Framework;
using Castle.DynamicProxy;
using Castle.Core;
using Castle.MicroKernel;
using Castle.MicroKernel.Registration;
public interface IIntercepted { string get(); }
[Interceptor(typeof(Te...