@ForeignKey(parentEntityClass = VmInstanceEO.class, onDeleteAction = ReferenceOption.CASCADE) private String virtualRouterUuid;
ForeignKeyInfo(Class entity, Field f) { ForeignKey annotation = f.getAnnotation(ForeignKey.class); if ("".equals(annotation.parentKey())) { Field parentKeyField = FieldUtils.getAnnotatedField(Id.class, annotation.parentEntityClass()); parentKey = parentKeyField.getName(); } else { parentKey = annotation.parentKey(); } parentClass = annotation.parentEntityClass(); onDeleteAction = annotation.onDeleteAction(); onUpdateAction = annotation.onUpdateAction(); fullName = String.format("%s.%s", annotation.parentEntityClass().getSimpleName(), parentKey); childKey = f.getName(); this.entity = entity; }
private long id; @Column @ForeignKey(parentEntityClass = VolumeSnapshotEO.class, onDeleteAction = ReferenceOption.CASCADE) private String volumeSnapshotUuid; @Column @ForeignKey(parentEntityClass = BackupStorageEO.class, onDeleteAction = ReferenceOption.CASCADE) private String backupStorageUuid; @Column
@ForeignKey(parentEntityClass = HostEO.class, onDeleteAction = ReferenceOption.CASCADE) private String hostUuid; @ForeignKey(parentEntityClass = ManagementNodeVO.class, onDeleteAction = ReferenceOption.SET_NULL) private String managementNodeId;
@ForeignKey(parentEntityClass = UserGroupVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String groupUuid; @ForeignKey(parentEntityClass = PolicyVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String policyUuid;
@ForeignKey(parentEntityClass = UserVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String userUuid; @ForeignKey(parentEntityClass = UserGroupVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String groupUuid;
@ForeignKey(parentEntityClass = UserVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String userUuid; @ForeignKey(parentEntityClass = PolicyVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String policyUuid;
public class HostAO extends ResourceVO { @Column @ForeignKey(parentEntityClass = ZoneEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String zoneUuid; @ForeignKey(parentEntityClass = ClusterEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String clusterUuid;
@ForeignKey(parentEntityClass = KeyValueBinaryVO.class, onDeleteAction = ReferenceOption.CASCADE) private String uuid;
@ForeignKey(parentEntityClass = ManagementNodeVO.class, onDeleteAction = ReferenceOption.SET_NULL) private String workerManagementNodeId;
@ForeignKey(parentEntityClass = RoleVO.class, parentKey = "uuid") private String roleUuid;
public class VolumeSnapshotTreeAO extends ResourceVO { @Column @ForeignKey(parentEntityClass = VolumeEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String volumeUuid;
@ForeignKey(parentEntityClass = JobQueueVO.class, onDeleteAction = ReferenceOption.CASCADE) private long jobQueueId; @ForeignKey(parentEntityClass = ManagementNodeVO.class, onDeleteAction = ReferenceOption.SET_NULL) private String issuerManagementNodeId;
@MappedSuperclass public class PrimaryStorageAO extends ResourceVO { @Column @ForeignKey(parentEntityClass = ZoneEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String zoneUuid;
@ForeignKey(parentEntityClass = VmInstanceEO.class, onDeleteAction = ReferenceOption.CASCADE) private String vmInstanceUuid; @ForeignKey(parentEntityClass = VmNicVO.class, onDeleteAction = ReferenceOption.CASCADE) private String vmNicUuid; @ForeignKey(parentEntityClass = SecurityGroupVO.class, onDeleteAction = ReferenceOption.CASCADE) private String securityGroupUuid;
@ForeignKey(parentEntityClass = ZoneEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String zoneUuid; @ForeignKey(parentEntityClass = ClusterEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String clusterUuid; @ForeignKey(parentEntityClass = ImageEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String imageUuid; @ForeignKey(parentEntityClass = HostEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String hostUuid; @ForeignKey(parentEntityClass = HostEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String lastHostUuid; @ForeignKey(parentEntityClass = InstanceOfferingEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String instanceOfferingUuid; @ForeignKey(parentEntityClass = VolumeEO.class, onDeleteAction = ReferenceOption.SET_NULL) private String rootVolumeUuid;
@ForeignKey(parentEntityClass = RoleVO.class, onDeleteAction = ForeignKey.ReferenceOption.CASCADE) private String roleUuid; @Column @Id @ForeignKey(parentEntityClass = PolicyVO.class, onDeleteAction = ForeignKey.ReferenceOption.CASCADE) private String policyUuid; @Column
@ForeignKey(parentEntityClass = LoadBalancerListenerVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String listenerUuid; @ForeignKey(parentEntityClass = VmNicVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String vmNicUuid;
@ForeignKey(parentEntityClass = AccountVO.class, onDeleteAction = ReferenceOption.CASCADE) private String ownerAccountUuid; @ForeignKey(parentEntityClass = AccountVO.class, onDeleteAction = ReferenceOption.CASCADE) private String receiverAccountUuid; @ForeignKey(parentEntityClass = ResourceVO.class, onDeleteAction = ReferenceOption.CASCADE) private String resourceUuid;
@ForeignKey(parentEntityClass = LoadBalancerListenerVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String listenerUuid; @ForeignKey(parentEntityClass = CertificateVO.class, parentKey = "uuid", onDeleteAction = ReferenceOption.CASCADE) private String certificateUuid;