HbnContainer, how it works?

Hi everyone,

I really would like to understand how HbnContainer does works. I read all about that and didn’t understand yet… Does it connects directly into the database?

For example: I’ve an Service Layer (PersonService), with two methods:

  • findAll()
  • findByName()

My Person POJO, has those atributes:

  • personId
  • personName
  • gender : FK, LAZY

I’ve used this:

HbnContainer<Person> container = new HbnContainer<Person>(Person.class, mySessionFactory),

and it returns a findAll of Person Entity.

But, how can I achieve an findByName() result? There’s any way to set the result data?

Regards!

Hi.

You can use addContainerFilter() to get some filtering.

Or you can extend HbnContainer and overwrite getBaseCriteria() to get special filtering.

Hope this helps.

Bye,
Horst