سؤال

I have a simple question and I hope I can find answer here! Can we mix hibernate model and DAO in same class? Is there a design Pattern which specify this?

Thank you

هل كانت مفيدة؟

المحلول

I think you're referring to ActiveRecord pattern, there the model class has methods to save(), get(), etc. This pattern is implemented in frameworks like Django and Ruby n' Rails. Hibernate uses Data mapper pattern instead.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top