nhibernate-envers icon indicating copy to clipboard operation
nhibernate-envers copied to clipboard

Extend modified flags to support track changes within components

Open robertovaldesperez opened this issue 4 years ago • 8 comments
trafficstars

One question, I have mapped the fields this way:

Component(x => x.RentSearchParameters, m => { m.Map(x => x.MinPrice).Column("precio_min_alquiler").Nullable(); m.Map(x => x.MaxPrice).Column("precio_max_alquiler").Nullable(); m.Map(x => x.ApproxPosition).Column("posicion_aproximada_alquiler").Nullable(); m.Map(x => x.Timing).Column("timing_alquiler").Nullable(); m.Map(x => x.Step).Column("step_alquiler").Nullable(); });

Is it possible to audit them separately?

precio_min_alquiler - MinPrice_mod precio_max_alquiler - MaxPrice_mod posicion_aproximada_alquiler - ApproxPosition_mod ...

instead of

precio_min_alquiler precio_max_alquiler posicion_aproximada_alquiler RentSearchParameters_mod ...

robertovaldesperez avatar Mar 03 '21 08:03 robertovaldesperez

Sorry, dont understand. What do you mean with "seperately"?

Also, is this a bug? Or is it a question how to use/configure Envers? If it is the latter, please post it here instead, http://groups.google.com/group/nhusers.

RogerKratz avatar Mar 03 '21 16:03 RogerKratz

@RogerKratz Is a question about use/configure I will ask in the community. thank you

robertovaldesperez avatar Mar 03 '21 17:03 robertovaldesperez

@RogerKratz I have asked in the community for 10 days but I have not received an answer. Could you help me with the previous question?

Component(x => x.RentSearchParameters, m => { m.Map(x => x.MinPrice).Column("precio_min_alquiler").Nullable(); m.Map(x => x.MaxPrice).Column("precio_max_alquiler").Nullable(); m.Map(x => x.ApproxPosition).Column("posicion_aproximada_alquiler").Nullable(); m.Map(x => x.Timing).Column("timing_alquiler").Nullable(); m.Map(x => x.Step).Column("step_alquiler").Nullable(); });

and I get this result:

... precio_min_alquiler precio_max_alquiler posicion_aproximada_alquiler RentSearchParameters_mod

Is it possible to configure nhibernate.envers so that each field has its corresponding field that indicates that it has been modified?

precio_min_alquiler - MinPrice_mod precio_max_alquiler - MaxPrice_mod posicion_aproximada_alquiler - ApproxPosition_mod ...

robertovaldesperez avatar Mar 15 '21 14:03 robertovaldesperez

Sorry, dont understand. what do you mean with "and I get this result"? Result of what? And what is "posicion_aproximada_alquiler"?

Do you want to have custom names of your property modification flags? Or do you want more/fewer flags?

How does your envers configuration look like?

RogerKratz avatar Mar 15 '21 16:03 RogerKratz

Hi @RogerKratz

I need to have a mod flag for each field, but with FluentNHibernate.Mapping.ComponentPart I only get one mod flag for all fields.

For example, this is my ClassMap

image

and envers generate one mod flag for all fields

image

and i need to generate a mod flag for each field with the FluentNHibernate.Mapping.ComponentPart, it's possible?

robertovaldesperez avatar Mar 15 '21 18:03 robertovaldesperez

Ah, I see. Didn't even remember that it worked that way (I don't use modified flags myself).

Modified flags is a direct port from Hibernate's envers version. Found this issue there, HHH-10859, so if I understand you correctly, I'm afraid what you want to do isn't possible ATM. I personally don't have the time trying to fix this, at least not until it's impl in Hibernate so it's easy to port. You are of course welcome to create a pull request and provide a fix yourself.

RogerKratz avatar Mar 15 '21 19:03 RogerKratz

reopening the issue now when when it's clear what it's about

RogerKratz avatar Mar 15 '21 19:03 RogerKratz

Hi @RogerKratz thank you so much for help me. I will wait for it to be fixed.

robertovaldesperez avatar Mar 15 '21 20:03 robertovaldesperez