Hibernate连接设计
我有以下实体,每个实体映射到数据库中的一个表
: 商业 客户
活动实体拥有该活动所针对的业务。 客户实体拥有其所属的业务。我通过搜索与活动具有相同business_id 的所有客户来获取活动的客户(猜测此设计可以改进)。
我需要找到自上次运行活动以来进入系统的所有活动客户,并将活动发送给他们。对此最好的设计是什么?
我认为我需要创建一个名为 CampaignClient (特定活动的客户端)的新实体,但我不知道如何使用 Hibernate 来实现它。
I have the following entities, each mapped to a table in the DB:
Campaign
Business
Client
Campaign entity holds the business that the campaign was opened for.
Client entity holds the business it belongs to. I get the campaign's clients by searching for all the clients who have the same business_id as the campaign (guess this design could be improved).
I need to find all campaign clients that were entered into the system since the last time the campaign was run and send the campaign to them as well. What would be the best design for this?
I think I need to create a new entity called CampaignClient (client of a specific campaign) but I don't know how to implement this with Hibernate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者,如果您没有企业与客户之间的关联(但您应该有一个):
Or, if you don't have an association from business to clients (but you should have one):