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 330297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:40:05+00:00 2026-05-12T09:40:05+00:00

I am starting a job with a mid size company working mostly on writing

  • 0

I am starting a job with a mid size company working mostly on writing custom apps that interact with their ERP system. This is my first time doing this sort of work, so the ERP concept is new to me and I am learning it piece meal.

I have only written two apps so far and have learned the database model as I went and only as much as I need to get the job done, but even with that limited amount I can start to see a big picture forming. My idea was then to write a library with all of the mappings/model objects stored there so that a new application can just reference this library. After that, each application would then create their own repository limiting access to only what they need and the perspective that makes sense.

The problem/question I have is how to deal with relationships inside the (N)Hibernate mappings. If I have an order object with full relationships mapped in this base library, there is nothing stopping someone from traveling those relationships forever (granted I’m the only programmer…). So using the repository as a sort of confinement of scope doesn’t work at all in this sense.

If instead I limit the relationships in the (N)Hibernate mapping for this order object, the Repository returns an order object that is bound with only the relationships that it requires for its scope. The downside is that I now have to create mappings for each project instead of having a single ‘mappings store’.

How do other people deal with this?

Kind of unrelated, but I’ve also been translating the (N)Hibernate persisted objects which may consist of several relationships into a sort of single-non-persisted object more suited to the specific application (usually much more influenced by the UI). Is this a common thing, or am I throwing some of the benefit of (N)Hibernate away by taking the returned objects and translating them into something else?

ps. About the DDD tag… I don’t know if this is stuff that DDD addresses in detail, but I do have the book on order. I’m not sure of a good resource to look before the book arrives though.

  • 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-12T09:40:05+00:00Added an answer on May 12, 2026 at 9:40 am

    Pretty old question. I guess you already found an answer, but in case…

    I see two ways of resolving your problem.

    1. Restrict table access via user account in your database. For example in mysql, you can do this. The drawback is that if all your domain classes are mapped and compiled in your nh dll, the programmer can still see these entities. If he/she tries to access it, it will trigger an exception (nh tries to access a database table, the database refuse).

    2. Create a dll for each case. But I guess you also might have to create several accounts.

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

Sidebar

Related Questions

I have a filepath that I would like to pull the starting directory job
I am going to be starting a new job soon and the company has
I've inherited an old system after starting a new job, none of the previous
Requirements: Define job that has start time t , batch size s , invocation
I am starting a new job on Monday. The company has a home grown
I'm starting a new job soon with a manufacturer and supplier of fibre-optic multiplexers.
I'm starting a little job manager, it will execute some Job object implement an
I'll be starting a new job soon where Scheme is heavily used. I currently
I'm writing a delayed_job clone for DataMapper. I've got what I think is working
I need to schedule a job starting from 0600 till 1800. The job should

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.