Search in sources :

Example 1 with EventTypeBehaviorId

use of com.redhat.cloud.notifications.models.EventTypeBehaviorId in project notifications-backend by RedHatInsights.

the class LifecycleITest method addEventTypeBehavior.

@Transactional
void addEventTypeBehavior(UUID eventTypeId, UUID behaviorGroupId) {
    EventType eventType = entityManager.find(EventType.class, eventTypeId);
    BehaviorGroup behaviorGroup = entityManager.find(BehaviorGroup.class, behaviorGroupId);
    EventTypeBehavior behavior = new EventTypeBehavior();
    behavior.setId(new EventTypeBehaviorId());
    behavior.setEventType(eventType);
    behavior.setBehaviorGroup(behaviorGroup);
    entityManager.persist(behavior);
}
Also used : EventType(com.redhat.cloud.notifications.models.EventType) BehaviorGroup(com.redhat.cloud.notifications.models.BehaviorGroup) EventTypeBehavior(com.redhat.cloud.notifications.models.EventTypeBehavior) EventTypeBehaviorId(com.redhat.cloud.notifications.models.EventTypeBehaviorId) Transactional(javax.transaction.Transactional)

Aggregations

BehaviorGroup (com.redhat.cloud.notifications.models.BehaviorGroup)1 EventType (com.redhat.cloud.notifications.models.EventType)1 EventTypeBehavior (com.redhat.cloud.notifications.models.EventTypeBehavior)1 EventTypeBehaviorId (com.redhat.cloud.notifications.models.EventTypeBehaviorId)1 Transactional (javax.transaction.Transactional)1