auditing

NInject, nHibernate, and auditing in ASP.NET MVC

你说的曾经没有我的故事 提交于 2019-11-28 11:19:27
问题 I am working on an inherited application which makes use of NInject and nHibernate as part of an ASP.NET MVC (C#) application. Currently, I'm looking at a problem with the auditing of modifications. Each entity has ChangedOn/ChangedBy and CreatedOn/CreatedBy fields, which are mapped to database columns. However, these either get filled with the wrong username or no username at all. I think this is because it has been configured in the wrong way, but I don't know enough about nHibernate and

Spring Data JPA Auditing not working for the JpaRepository update method with @Modifying annotation, why?

纵然是瞬间 提交于 2019-11-28 06:49:42
问题 I am working on Spring Data JPA and Postgres example. In this example, I've implemented Auditing by following link: https://www.baeldung.com/database-auditing-jpa and Spring Boot JPA@CreatedDate @LastModifiedDate not being populated when saving the object. Auditing working very fine When I do the repository.save, in this case both fields annotated with @CreatedDate and @LastModifiedDate are saving correctly. But same is not happening when I'm trying to update the method. I've developed

MappedSuperclass Alternatives in Grails

老子叫甜甜 提交于 2019-11-28 01:55:33
问题 In many past projects, I used this JPA / Hibernate approach to add auditing capabilities to a system. It's very effective and unobtrusive. Is there a Grails @MappedSuperclass alternative (short of coding domain model objects in Java instead of Groovy)? How can one declare a parent class in a table-per-subclass approach without having a table created for it? I've read the GORM documentation (5.2.3 Inheritance in GORM) but besides the table-per-hierarchy vs. table-per-subclass discussion, I did

Entity Framework - Auditing activity

依然范特西╮ 提交于 2019-11-27 20:16:03
My database has a 'LastModifiedUser' column on every table in which I intend to collect the logged in user from an application who makes a change. I am not talking about the database user so essentially this is just a string on each entity. I would like to find a way to default this for each entity so that other developers don't have to remember to assign it any time they instantiate the entity. So something like this would occur: using (EntityContext ctx = new EntityContext()) { MyEntity foo = new MyEntity(); // Trying to avoid having the following line every time // a new entity is created

Finding property differences between two C# objects

徘徊边缘 提交于 2019-11-26 09:18:27
问题 The project I\'m working on needs some simple audit logging for when a user changes their email, billing address, etc. The objects we\'re working with are coming from different sources, one a WCF service, the other a web service. I\'ve implemented the following method using reflection to find changes to the properties on two different objects. This generates a list of the properties that have differences along with their old and new values. public static IList GenerateAuditLogMessages(T