Class CommonLinkDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.CommonLinkDAO
Direct Known Subclasses:
CustomerLinkDAO, ProcessLinkDAO

public abstract class CommonLinkDAO extends CommonDAO
  • Constructor Details

    • CommonLinkDAO

      protected CommonLinkDAO(Connection con)
  • Method Details

    • getLinkDAO

      public static CommonLinkDAO getLinkDAO(String objectType, Connection con)
    • getObjectLinksWithType

      public List<CommonObjectLink> getObjectLinksWithType(int objectId, String typeLike)
      Returns a list of entities linked to the object
      Parameters:
      objectId - the object ID
      typeLike - MySQL LIKE expression for filtering, optional
      Returns:
      the link list
    • prepareLink

      public CommonObjectLink prepareLink(CommonObjectLink link)
    • updateLinkTitles

      public void updateLinkTitles(int linkedObjectId, String linkedObjectTypeLike, String title)
    • addLink

      public void addLink(CommonObjectLink link)
      Links an object
      Parameters:
      link - the link
    • addLinkIfNotExist

      public void addLinkIfNotExist(CommonObjectLink link)
      Links an object if it isn't already linked to the given object
      Parameters:
      link - the link
    • isLinkExists

      public boolean isLinkExists(CommonObjectLink link)
      Checks whether a link exists
      Parameters:
      link - the link
      Returns:
      true if the link exists
    • deleteLink

      public void deleteLink(CommonObjectLink link)
      Deletes an object's link to one other object
      Parameters:
      link - the link
    • deleteObjectLinks

      public void deleteObjectLinks(int objectId)
      Deletes all links of the object
      Parameters:
      objectId - the object ID
    • deleteLinksTo

      public void deleteLinksTo(CommonObjectLink link)
      Deletes all links from objects of this type to some other object
      Parameters:
      link - the link
    • deleteLinksWithType

      public void deleteLinksWithType(CommonObjectLink link)
      Deletes all links from objects of this type to a given other object type
      Parameters:
      link - the link
    • copyLinks

      public void copyLinks(int objectFromId, int objectToId, String typePrefix)
    • copyLinks

      public void copyLinks(int objectFromId, int objectToId, String typePrefix, String excludeType)
    • getTable

      protected abstract String getTable()
    • getColumnName

      protected abstract String getColumnName()
    • getObjectType

      protected abstract String getObjectType()