Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend modified flags to support track changes within components #34

Open
robertovaldesperez opened this issue Mar 3, 2021 · 8 comments

Comments

@robertovaldesperez
Copy link

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
...

@RogerKratz
Copy link
Collaborator

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.

@robertovaldesperez
Copy link
Author

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

@robertovaldesperez
Copy link
Author

@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
...

@RogerKratz
Copy link
Collaborator

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?

@robertovaldesperez
Copy link
Author

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?

@RogerKratz
Copy link
Collaborator

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 RogerKratz changed the title Audit component part Extend modified flags support to track changes within components Mar 15, 2021
@RogerKratz RogerKratz changed the title Extend modified flags support to track changes within components Extend modified flags to support track changes within components Mar 15, 2021
@RogerKratz
Copy link
Collaborator

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

@RogerKratz RogerKratz reopened this Mar 15, 2021
@robertovaldesperez
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants