Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:47:26+00:00 2026-05-23T10:47:26+00:00

Can you give a simple definition of NHibernate ‘proxy’ please. As an example, this

  • 0

Can you give a simple definition of NHibernate ‘proxy’ please.

As an example, this is a citation from Manning Nhibernate in Action book:

‘For a or
association, lazy fetching is possible
only if the associated class mapping
enables proxying.’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:47:26+00:00Added an answer on May 23, 2026 at 10:47 am

    It means that it will create a class that inherits your original entity, and override the actual property that would represent the associated class.

    By that, it can implement logic that would fetch the data from DB in order to achieve the laziness, instead of always having that data available.

    For Collections though, this is implemented in NHibernate versions of ISet and IList etc. This is only relevant in many-to-one or one-to-one relations.

    Example:

    public class YourEntity {
        public virtual OtherEntity Entity { get; set; }
    }
    
    public class DynamicProxyEntity : YourEntity {
        private OtherEntity entity;
    
        public override OtherEntity Entity {
            get { return entity = LoadFromDb(); }
            set { this.entity = value; }
        }
    }
    

    This is a very simplistic version of it, hopefully it will give you an insight on how it works. This of course can bring problems into your app because you won’t have an instance of your actual Entity-type, but the derived one. If you’ve decorated your classes with attributes and such, those might not be identified (depending on your code). also, type checking etc can break if you’re not careful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone give me a simple example involving threads in this manner, please. Problem
Can someone give me a simple definition about Thread in android. I read the
Can anyone give a simple example of a DB transaction using an Intentional Shared
Can someone give a simple example of updating a textfield every second or so?
can someone give me simple example in c, of using pipe() system call to
can you give me a simple example of inheritance and polymorphism, so it could
Can anybody give me a simple TDI driver which can block traffic from specified
Can you give me a simple example of nant build file which builds watin/nunit
who can give me a simple code , i want a simplest way to
Can anybody give a link for a simple explanation on BFS and DFS with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.