@Entity
@OptimisticLocking(type = OptimisticLockType.DIRTY)
@DynamicUpdate
@Cacheable
@org.hibernate.annotations.Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL, region = "shared")
@Table(name = "FOLDER", schema = "TRUTH")
public class Folder extends _Folder {}
@MappedSuperclass
@Access(AccessType.FIELD)
@CollectionRoles(roles ={
"com.opsware.shared.ejb.entity.Folder.children",
"com.opsware.shared.ejb.entity.Folder.folder",
"com.opsware.shared.ejb.entity.Folder.folderLink",
})
abstract public class _Folder {
@OneToMany(targetEntity = FolderFolderLink.class, mappedBy= "realFolder")
@org.hibernate.annotations.CollectionType(type=com.opsware.twist.jpa.PersistentSetType.class)
@org.hibernate.annotations.Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL, region="shared_collections")
final java.util.Set folderLink = new HashSet();
}
@Entity
@OptimisticLocking(type = OptimisticLockType.DIRTY)
@DynamicUpdate
@Cacheable
@org.hibernate.annotations.Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL, region = "shared")
@Table(name = "FOLDER_FOLDER_LINK", schema = "TRUTH")
public class FolderFolderLink extends _FolderFolderLink {}
@MappedSuperclass
@Access(AccessType.FIELD)
@IdClass(FolderFolderLinkPK.class)
abstract public class _FolderFolderLink {
@Id
@Column(name="FOLDER_ID")
Long folderId;
@OptimisticLock(excluded = true)
@Column(name="LINK_TYPE_NAME", insertable = false, updatable = false)
String linkTypeName;
@Id
@Column(name="PARENT_FOLDER_ID")
Long parentFolderId;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "LINK_TYPE_NAME")
LinkType linkType;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_FOLDER_ID", insertable = false, updatable = false)
Folder parent;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "FOLDER_ID", insertable = false, updatable = false)
Folder realFolder;
}