@CTAware @ProviderType @Transactional(isolation=PORTAL, rollbackFor={PortalException.class,SystemException.class}) public interface AssetLinkLocalService extends BaseLocalService, CTService<AssetLink>, PersistedModelLocalService
AssetLinkLocalServiceUtil
Modifier and Type | Method and Description |
---|---|
AssetLink |
addAssetLink(AssetLink assetLink)
Adds the asset link to the database.
|
AssetLink |
addLink(long userId,
long entryId1,
long entryId2,
int type,
int weight)
Adds a new asset link.
|
AssetLink |
createAssetLink(long linkId)
Creates a new asset link with the primary key.
|
PersistedModel |
createPersistedModel(Serializable primaryKeyObj) |
AssetLink |
deleteAssetLink(AssetLink assetLink)
Deletes the asset link from the database.
|
AssetLink |
deleteAssetLink(long linkId)
Deletes the asset link with the primary key from the database.
|
void |
deleteGroupLinks(long groupId) |
void |
deleteLink(AssetLink link)
Deletes the asset link.
|
void |
deleteLink(long linkId)
Deletes the asset link.
|
void |
deleteLinks(long entryId)
Deletes all links associated with the asset entry.
|
void |
deleteLinks(long entryId1,
long entryId2)
Delete all links that associate the two asset entries.
|
PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
<T> T |
dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
int |
dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
DynamicQuery |
dynamicQuery() |
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
Performs a dynamic query on the database and returns a range of the matching rows.
|
<T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.
|
long |
dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows matching the dynamic query.
|
AssetLink |
fetchAssetLink(long linkId) |
ActionableDynamicQuery |
getActionableDynamicQuery() |
AssetLink |
getAssetLink(long linkId)
Returns the asset link with the primary key.
|
List<AssetLink> |
getAssetLinks(int start,
int end)
Returns a range of all the asset links.
|
int |
getAssetLinksCount()
Returns the number of asset links.
|
CTPersistence<AssetLink> |
getCTPersistence() |
List<AssetLink> |
getDirectLinks(long entryId)
Returns all the asset links whose first entry ID is the given entry ID.
|
List<AssetLink> |
getDirectLinks(long entryId,
boolean excludeInvisibleLinks) |
List<AssetLink> |
getDirectLinks(long entryId,
int typeId)
Returns all the asset links of the given link type whose first entry ID
is the given entry ID.
|
List<AssetLink> |
getDirectLinks(long entryId,
int typeId,
boolean excludeInvisibleLinks) |
IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
List<AssetLink> |
getLinks(long entryId)
Returns all the asset links whose first or second entry ID is the given
entry ID.
|
List<AssetLink> |
getLinks(long groupId,
Date startDate,
Date endDate,
int start,
int end) |
List<AssetLink> |
getLinks(long entryId,
int typeId)
Returns all the asset links of the given link type whose first or second
entry ID is the given entry ID.
|
List<AssetLink> |
getLinks(long classNameId,
long classPK)
Returns all the asset links of an AssetEntry.
|
Class<AssetLink> |
getModelClass() |
String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
List<AssetLink> |
getReverseLinks(long entryId,
int typeId)
Returns all the asset links of the given link type whose second entry ID
is the given entry ID.
|
AssetLink |
updateAssetLink(AssetLink assetLink)
Updates the asset link in the database or adds it if it does not yet exist.
|
AssetLink |
updateLink(long userId,
long entryId1,
long entryId2,
int typeId,
int weight) |
void |
updateLinks(long userId,
long entryId,
long[] linkEntryIds,
int typeId)
Updates all links of the asset entry, replacing them with links
associating the asset entry with the asset entries of the given link
entry IDs.
|
<R,E extends Throwable> |
updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<AssetLink>,R,E> updateUnsafeFunction) |
getBasePersistence
@Indexable(type=REINDEX) AssetLink addAssetLink(AssetLink assetLink)
Important: Inspect AssetLinkLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
assetLink
- the asset linkAssetLink addLink(long userId, long entryId1, long entryId2, int type, int weight) throws PortalException
userId
- the primary key of the link's creatorentryId1
- the primary key of the first asset entryentryId2
- the primary key of the second asset entrytype
- the link type. Acceptable values include AssetLinkConstants#TYPE_RELATED
which is a bidirectional
relationship and AssetLinkConstants#TYPE_CHILD
which is a
unidirectional relationship. For more information see AssetLinkConstants
weight
- the weight of the relationship, allowing precedence
ordering of linksPortalException
@Transactional(enabled=false) AssetLink createAssetLink(long linkId)
linkId
- the primary key for the new asset linkPersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
createPersistedModel
in interface PersistedModelLocalService
PortalException
@Indexable(type=DELETE) AssetLink deleteAssetLink(AssetLink assetLink)
Important: Inspect AssetLinkLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
assetLink
- the asset link@Indexable(type=DELETE) AssetLink deleteAssetLink(long linkId) throws PortalException
Important: Inspect AssetLinkLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
linkId
- the primary key of the asset linkPortalException
- if a asset link with the primary key could not be foundvoid deleteGroupLinks(long groupId)
void deleteLink(AssetLink link)
link
- the asset linkvoid deleteLink(long linkId) throws PortalException
linkId
- the primary key of the asset linkPortalException
void deleteLinks(long entryId)
entryId
- the primary key of the asset entryvoid deleteLinks(long entryId1, long entryId2)
entryId1
- the primary key of the first asset entryentryId2
- the primary key of the second asset entryPersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
deletePersistedModel
in interface PersistedModelLocalService
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
dslQuery
in interface PersistedModelLocalService
@Transactional(propagation=SUPPORTS, readOnly=true) int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
dslQueryCount
in interface PersistedModelLocalService
@Transactional(propagation=SUPPORTS, readOnly=true) DynamicQuery dynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.asset.model.impl.AssetLinkModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.asset.model.impl.AssetLinkModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query@Transactional(propagation=SUPPORTS, readOnly=true) AssetLink fetchAssetLink(long linkId)
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) AssetLink getAssetLink(long linkId) throws PortalException
linkId
- the primary key of the asset linkPortalException
- if a asset link with the primary key could not be found@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getAssetLinks(int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.asset.model.impl.AssetLinkModelImpl
.
start
- the lower bound of the range of asset linksend
- the upper bound of the range of asset links (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) int getAssetLinksCount()
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getDirectLinks(long entryId)
entryId
- the primary key of the asset entry@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getDirectLinks(long entryId, boolean excludeInvisibleLinks)
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getDirectLinks(long entryId, int typeId)
entryId
- the primary key of the asset entrytypeId
- the link type. Acceptable values include AssetLinkConstants#TYPE_RELATED
which is a bidirectional
relationship and AssetLinkConstants#TYPE_CHILD
which is a
unidirectional relationship. For more information see AssetLinkConstants
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getDirectLinks(long entryId, int typeId, boolean excludeInvisibleLinks)
@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getLinks(long entryId)
entryId
- the primary key of the asset entry@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getLinks(long groupId, Date startDate, Date endDate, int start, int end)
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getLinks(long entryId, int typeId)
entryId
- the primary key of the asset entrytypeId
- the link type. Acceptable values include AssetLinkConstants#TYPE_RELATED
which is a bidirectional
relationship and AssetLinkConstants#TYPE_CHILD
which is a
unidirectional relationship. For more information see AssetLinkConstants
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getLinks(long classNameId, long classPK)
classNameId
- AssetEntry's classNameIdclassPK
- AssetEntry's classPKString getOSGiServiceIdentifier()
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
getPersistedModel
in interface PersistedModelLocalService
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<AssetLink> getReverseLinks(long entryId, int typeId)
entryId
- the primary key of the asset entrytypeId
- the link type. Acceptable values include AssetLinkConstants#TYPE_RELATED
which is a bidirectional
relationship and AssetLinkConstants#TYPE_CHILD
which is a
unidirectional relationship. For more information see AssetLinkConstants
@Indexable(type=REINDEX) AssetLink updateAssetLink(AssetLink assetLink)
Important: Inspect AssetLinkLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
assetLink
- the asset linkAssetLink updateLink(long userId, long entryId1, long entryId2, int typeId, int weight) throws PortalException
PortalException
void updateLinks(long userId, long entryId, long[] linkEntryIds, int typeId) throws PortalException
If no link exists with a given link entry ID, a new link is created associating the current asset entry with the asset entry of that link entry ID. An existing link is deleted if either of its entry IDs is not contained in the given link entry IDs.
userId
- the primary key of the user updating the linksentryId
- the primary key of the asset entry to be managedlinkEntryIds
- the primary keys of the asset entries to be linked
with the asset entry to be managedtypeId
- the type of the asset links to be created. Acceptable
values include AssetLinkConstants#TYPE_RELATED
which is a
bidirectional relationship and AssetLinkConstants#TYPE_CHILD
which is a unidirectional
relationship. For more information see AssetLinkConstants
PortalException
@Transactional(enabled=false) CTPersistence<AssetLink> getCTPersistence()
getCTPersistence
in interface CTService<AssetLink>
@Transactional(enabled=false) Class<AssetLink> getModelClass()
getModelClass
in interface CTService<AssetLink>
@Transactional(rollbackFor=java.lang.Throwable.class) <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<AssetLink>,R,E> updateUnsafeFunction) throws E extends Throwable
updateWithUnsafeFunction
in interface CTService<AssetLink>
E extends Throwable