________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick [rpmc...@gmail.com]
Skickat: den 21 mars 2012 19:28
Till: nhu...@googlegroups.com
Ämne: [nhusers] Envers with a PrimitiveType
Thanks,
Patrick
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/Pw0Nkff7kL0J.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
Custom user types is suppose to work just fine with Envers. Can you send a failing test (using hbm mapping) here please?
https://nhibernate.jira.com/browse/NHE
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
<< Would you be willing to accept a small custom test project?>>
I really would prefer an unit test. A good starting point is to copy/paste a custom user type test already in envers code base – they are here
Simply add a new test in that folder and create a patch (or do a pull request on bitbucket).
Thanks
Roger
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ASKN74a-YSYJ.
To post to this group, send email to nhu...@googlegroups.com
.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ASKN74a-YSYJ.
To post to this group, send email to nhu...@googlegroups.com
.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at
<< I'm treating it as a collection of value types (no Id) which I think is what section 9.1 of the documentation says is not supported. Am I understanding that correctly? >>
Yes, it’s not currently supported I’m afraid.
To be honest, don’t really know what happens in your scenario (a collection of custom user types). Out of curiousity – don’t you get a “nice” (hmm.. well…) exception saying this isn’t supported? What is your stack trace?
/Roger
From: nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] On Behalf Of Patrick
Sent: den 22 mars 2012 14:26
To: nhu...@googlegroups.com
Subject: Re: [nhusers] Envers with a PrimitiveType
Will do. I started working on it last night. Hopefully I'll have something worked out by this weekend.
On a related note, I also have an ICompositeUserType that wasn't working but I think I know why. I'm treating it as a collection of value types (no Id) which I think is what section 9.1 of the documentation says is not supported. Am I understanding that correctly?
Thanks,
Patrick
On Thursday, March 22, 2012 3:51:55 AM UTC-5, Roger wrote:
<< Would you be willing to accept a small custom test project?>>
I really would prefer an unit test. A good starting point is to copy/paste a custom user type test already in envers code base – they are here
Simply add a new test in that folder and create a patch (or do a pull request on bitbucket).
Thanks
Roger
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ASKN74a-YSYJ.
To post to this group, send email to nhu...@googlegroups.com
.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/Mi76anx1rtoJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ASKN74a-YSYJ.
To post to this group, send email to nhu...@googlegroups.com
.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/Mi76anx1rtoJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ASKN74a-YSYJ.
To post to this group, send email to nhu...@googlegroups.com
.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
For more options, visit this group at
I'm not really sure I understand your problem but...
It's mandatory that the revision entity has a revision number and a revision timestamp. However, you can rename it to whatever you want though (both in domain model and in db schema).
It seems you're using attribute configuration? In that case, something like...
[RevisionEntity(typeof(EnversRevisionListener))]
public class EnversRevisionEntity
{
[RevisionNumber]
public virtual long RevisionId {get;set;}
[RevisionTimestamp]
public virtual DateTime TheTimeStamp {get;set;}
}
Or if you're using fluent cfg...
public class EnversRevisionEntity
{
public virtual long RevisionId {get;set;}
public virtual DateTime TheTimeStamp {get;set;}
}
fluentCfg.SetRevisionEntity<EnversRevisionEntity>(e => e.RevisionId, e => e.TheTimeStamp, new EnversRevisionListener());
/Roger
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick
No, not currently. It must be some sort of number because it's used in some queries (eg "<=", "max", "between").
<<Also, are you using UTC times for the timestamps?>>
Hmm... It _should_ be, but I'm not sure it is. If it isn't, please JIRA this.
________________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Peter Morris [mrpm...@gmail.com]
Skickat: den 31 mars 2012 11:33
Till: nhusers
Ämne: [nhusers] Re: Envers with a PrimitiveType
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick [rpmc...@gmail.com]
Skickat: den 31 mars 2012 01:42
Till: nhu...@googlegroups.com
Ämne: Re: [nhusers] Envers with a PrimitiveType
I'll try and explain it a little better. At the end of section 4 of the documentation, there is this sentence: "Having an "empty" revision entity - that is, with no additional properties except the two mandatory ones - is
but instead I get:
-Patrick
/Roger
________________________________
Från: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com> [nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>] för Patrick
Skickat: den 30 mars 2012 17:07
Till: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>
Ämne: Re: [nhusers] Envers with a PrimitiveType
Thanks for helping me resolve that issue, but I'm having a separate problem now (maybe I need a new thread). I've tried replacing the DefaultRevisionEntity with one of my own making but in the schema nHibernate is generating (and expecting) both the entities fields (Id & RevisionDate) and the defaults (REV & REVTSTMP). Any thoughts? Relevant code and schema are below.
[RevisionEntity(typeof(EnversRevisionListener))]
public class EnversRevisionEntity : DefaultRevisionEntity
{
public EnversRevisionEntity() { }
public virtual User User { get; set; }
}
create table Audit.REVINFO (
Id INT not null,
UserFk INT null,
RevisionDate DATETIME null,
REV INT IDENTITY NOT NULL,
REVTSTMP DateTime null,
primary key (REV)
)
Thanks,
Patrick
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/olwpYMmefLkJ.
What's you mapping for EnversRevisionEntity?
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick
________________________________
Från: nhu...@googlegroups.com<mailto:nhusers@googlegroups.com> [nhu...@googlegroups.com<mailto:nhusers@googlegroups.com>] för Patrick
Skickat: den 30 mars 2012 17:07
Till: nhu...@googlegroups.com<mailto:nhusers@googlegroups.com>
Ämne: Re: [nhusers] Envers with a PrimitiveType
Thanks for helping me resolve that issue, but I'm having a separate problem now (maybe I need a new thread). I've tried replacing the DefaultRevisionEntity with one of my own making but in the schema nHibernate is generating (and expecting) both the entities fields (Id & RevisionDate) and the defaults (REV & REVTSTMP). Any thoughts? Relevant code and schema are below.
[RevisionEntity(typeof(EnversRevisionListener))]
public class EnversRevisionEntity : DefaultRevisionEntity
{
public EnversRevisionEntity() { }public virtual User User { get; set; }
}create table Audit.REVINFO (
Id INT not null,
UserFk INT null,
RevisionDate DATETIME null,
REV INT IDENTITY NOT NULL,
REVTSTMP DateTime null,
primary key (REV)
)Thanks,
Patrick
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/olwpYMmefLkJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.
<<If so, I'll see if I can find a good spot for another test case.>>
Please do.
Thanks.
Roger
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Patrick [rpmc...@gmail.com]
Skickat: den 4 april 2012 00:43
Till: nhu...@googlegroups.com
Ämne: Re: [nhusers] Envers with a PrimitiveType
Well, I'm using the ConventionModelMapper so no real configuration to speak of. I can still post it if you would like, but I was hoping I had just made some common mistake.
I'm under a pretty tight deadline so I just added the required properties directly to my revision class and removed the inheritance from DefaultRevisionEntity. The schema is now what I expected. I really think it might be my fault so I'll see if I can reproduce the issue with a minimal project. If so, I'll see if I can find a good spot for another test case.
-Patrick
On Sunday, April 1, 2012 9:53:44 AM UTC-5, Roger wrote:
What's you mapping for EnversRevisionEntity?
________________________________
Från: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com> [nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>] för Patrick
Skickat: den 31 mars 2012 01:42
Till: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>
but instead I get:
-Patrick
/Roger
________________________________
Från: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com><mailto:nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>> [nhu...@googlegroups.com<mailto:nhu...@googlegroups.com><mailto:nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>>] för Patrick
Skickat: den 30 mars 2012 17:07
Till: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com><mailto:nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>>
Ämne: Re: [nhusers] Envers with a PrimitiveType
Thanks for helping me resolve that issue, but I'm having a separate problem now (maybe I need a new thread). I've tried replacing the DefaultRevisionEntity with one of my own making but in the schema nHibernate is generating (and expecting) both the entities fields (Id & RevisionDate) and the defaults (REV & REVTSTMP). Any thoughts? Relevant code and schema are below.
[RevisionEntity(typeof(EnversRevisionListener))]
public class EnversRevisionEntity : DefaultRevisionEntity
{
public EnversRevisionEntity() { }
public virtual User User { get; set; }
}
create table Audit.REVINFO (
Id INT not null,
UserFk INT null,
RevisionDate DATETIME null,
REV INT IDENTITY NOT NULL,
REVTSTMP DateTime null,
primary key (REV)
)
Thanks,
Patrick
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/olwpYMmefLkJ.
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/GfRqY11ujWYJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
Depending on the precision on the db column you might end up with two identical datetimes.
<< Surely people think in terms of Revisions and revision ranges, not revision numbers?>>
Yes, the revision id has no real business value. It's a primary key.
<< No, it only uses DateTime.Now - Where do I go to add it to JIRA?>>
https://nhibernate.jira.com/browse/NHE
--