Tag Info

New answers tagged

0

Generally speaking, it is not good to duplicate values unless there is a valid reason. For the above solution, it is definitely not a good idea. Though it might seem counter-intuitive, ORMs by default (Hibernate) prefer to load and save all the fields of an entity (recommended upto a limit ~50 columns). The main reason is that they can pre-build these SQLs ...


1

I think you are treading on dangerous ground here. On one hand you have an LDAP authentication system which also has user name, and extra info in it. On the other you have a domain concept of a product owner. Its tempting to see the LDAP service as just a repository for product owners, but I dont think it really is. you will have all sorts of users in AD, ...


1

I have done some more research in domain driven development. Bounded Contexts seemed to help me solve this problem. I started modeling out the system and not caring about the persistence, as you should do with DDD. In the infrastructure level, I have separated out where data should be saved. The data that is related to the User and Organisation for ...


0

Hibernate has events to which you can react using interceptors. Here's an incomplete list of events: onDelete onSave instantiate afterTransactionCompletion Take a look at org.hibernate.Interceptor to see complete list of events to which you can react using Interceptor. Simplified example of classical usage is auditting interceptor which sets ...


1

As you see, the solution might not be very satisfying. The problem of data access at all is, that we have to consider many different aspects which make code not 100% reusable. It's about transactions and locking, and the way e.g. ORM maps a relational database to objects and vice versa. Mostly if you try to write architecture components, trying to solve the ...


1

I prefer the Table Data Gateway pattern, i.e. a stateless object for roughly each entity type, containg methods such as void CustomerRepository.createCustomer(Customer c) List<Customer> CustomerRepository.getCustomersByCountry(String country) Easy to add additional handling such as serialization, error handling, logging, validation, caching. Easy ...



Top 50 recent answers are included