one to many relationship : to implement (and how) or not to implement a Repository ?
I am trying to implement a slightly modified version of XEP-0142 in a tigase component.
It is an extension that enables a user to communicate with a representative of an organization, department, or workgroup.
this XEP implies a one to many relationship beetween Workgroups and queues, workgroups and users and I want to be able to configure all of them.
So I am wondering what is my best option to implement configuration mechanism from a database:
- Implement a repository like for vhosts or other stuff. This has the advantage of allowing ad-hoc commands (that's what says the docs).
But is it possible to have a one to many relationship beetween two implementations of
tigase.db.comp.RepositoryItemAbstract ? How ?
Documentation seems very poor about repositories, so any help would be appreciated...
- Wouldn't it be easier to implement my own db connector ? But how could I implement ad-hoc commands ?
Any hint about how to implement such a thing or information about repositories in tigase would be welcome.
Added by Julien Durens about 3 years ago
Hi, thank you for your answer,
Actually, I'm a bit lost about Tigase database implementation.
But what I've seen and read makes me think that more or less everything is or belongs to a user. Am I right or do I misunderstand everything ?
If I am right, I would need to create a "mycomponent" user (for managing global component config, for example), and add datas via the user repository API.
Then every workgroup and every queue would be a user or subnodes of my main "mycomponent" user with datas set in other subnodes to store my component state.
Is that true or do I need to RTFM more carefuly :-) ?