org.jboss.dna.connector.store.jpa.model.basic
Class ReferenceEntity

java.lang.Object
  extended by org.jboss.dna.connector.store.jpa.model.basic.ReferenceEntity

public class ReferenceEntity
extends Object

A record of a reference from one node to another.


Constructor Summary
ReferenceEntity()
           
ReferenceEntity(ReferenceId id)
           
 
Method Summary
static int countAllReferencesResolved(Long workspaceId, javax.persistence.EntityManager manager)
          Delete all references that start from nodes that do not support enforced referential integrity.
static int deleteReferencesFrom(Long workspaceId, String uuid, javax.persistence.EntityManager manager)
          Delete all references that start from the node with the supplied UUID.
static int deleteUnenforcedReferences(Long workspaceId, javax.persistence.EntityManager manager)
          Delete all references (in all workspaces) that start from nodes that do not require enforced referential integrity.
 boolean equals(Object obj)
          
 ReferenceId getId()
           
static List<ReferenceEntity> getReferencesToUuids(Long workspaceId, Collection<String> uuids, javax.persistence.EntityManager manager)
          Returns a list of all references to UUIDs in the given list within the given workspace
 int hashCode()
          
 void setId(ReferenceId id)
           
 String toString()
          
static List<ReferenceEntity> verifyAllReferencesResolved(Long workspaceId, javax.persistence.EntityManager manager)
          Delete all references that start from nodes that do not support enforced referential integrity.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceEntity

public ReferenceEntity()

ReferenceEntity

public ReferenceEntity(ReferenceId id)
Parameters:
id - the id
Method Detail

getId

public ReferenceId getId()
Returns:
id

setId

public void setId(ReferenceId id)
Parameters:
id - Sets id to the specified value.

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

deleteReferencesFrom

public static int deleteReferencesFrom(Long workspaceId,
                                       String uuid,
                                       javax.persistence.EntityManager manager)
Delete all references that start from the node with the supplied UUID.

Parameters:
workspaceId - the ID of the workspace; may not be null
uuid - the UUID of the node from which the references start
manager - the manager; may not be null
Returns:
the number of deleted references

deleteUnenforcedReferences

public static int deleteUnenforcedReferences(Long workspaceId,
                                             javax.persistence.EntityManager manager)
Delete all references (in all workspaces) that start from nodes that do not require enforced referential integrity.

Parameters:
workspaceId - the ID of the workspace; may not be null
manager - the manager; may not be null
Returns:
the number of deleted references

countAllReferencesResolved

public static int countAllReferencesResolved(Long workspaceId,
                                             javax.persistence.EntityManager manager)
Delete all references that start from nodes that do not support enforced referential integrity.

Parameters:
workspaceId - the ID of the workspace; may not be null
manager - the manager; may not be null
Returns:
the number of deleted references

verifyAllReferencesResolved

public static List<ReferenceEntity> verifyAllReferencesResolved(Long workspaceId,
                                                                javax.persistence.EntityManager manager)
Delete all references that start from nodes that do not support enforced referential integrity.

Parameters:
workspaceId - the ID of the workspace; may not be null
manager - the manager; may not be null
Returns:
the number of deleted references

getReferencesToUuids

public static List<ReferenceEntity> getReferencesToUuids(Long workspaceId,
                                                         Collection<String> uuids,
                                                         javax.persistence.EntityManager manager)
Returns a list of all references to UUIDs in the given list within the given workspace

Parameters:
workspaceId - the ID of the workspace; may not be null
uuids - the UUIDs (as strings) of the nodes to check; may not be null
manager - the manager; may not be null
Returns:
the number of deleted references


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.