Alo

I have a document object which can have one parent document and one
child document. A chain like this:

first version document (no parent, one child) - second version
document (one parent, one child) - third version document (one parent,
no child)

I have this mapping:

    [ActiveRecord(Lazy = true)]
    public class Registration
    {
        [BelongsTo("ParentDocumentId")]
        public virtual Document ParentDocument { get; set; }

        [HasMany]
        public virtual IList<Document> ChildDocuments { get; set; }

        public virtual Document ChildDocument
        {
            get
            {
                return ChildDocuments != null && ChildDocuments.Count
== 1 ? ChildDocuments[0] : null;
            }
            set
            {
                if (ChildDocuments == null) ChildDocuments = new
List<Document>();
                ChildDocuments.Add(value);
            }
        }
    }

How can I make a query to get the last Document (third version
document). I can't really figure out how to use HQL or criteria to
solve this problem.

Thx in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to