001
014
015 package com.liferay.portal.service.persistence.impl;
016
017 import com.liferay.portal.kernel.exception.SystemException;
018 import com.liferay.portal.kernel.util.OrderByComparator;
019 import com.liferay.portal.model.BaseModel;
020
021 import java.util.List;
022
023
026 public class ReverseTableMapper<L extends BaseModel<L>, R extends BaseModel<R>>
027 implements TableMapper<L, R> {
028
029 public ReverseTableMapper(TableMapper<R, L> tableMapper) {
030 _tableMapper = tableMapper;
031 }
032
033 @Override
034 public boolean addTableMapping(long leftPrimaryKey, long rightPrimaryKey)
035 throws SystemException {
036
037 return _tableMapper.addTableMapping(rightPrimaryKey, leftPrimaryKey);
038 }
039
040 @Override
041 public boolean containsTableMapping(
042 long leftPrimaryKey, long rightPrimaryKey)
043 throws SystemException {
044
045 return _tableMapper.containsTableMapping(
046 rightPrimaryKey, leftPrimaryKey);
047 }
048
049 @Override
050 public int deleteLeftPrimaryKeyTableMappings(long leftPrimaryKey)
051 throws SystemException {
052
053 return _tableMapper.deleteRightPrimaryKeyTableMappings(leftPrimaryKey);
054 }
055
056 @Override
057 public int deleteRightPrimaryKeyTableMappings(long rightPrimaryKey)
058 throws SystemException {
059
060 return _tableMapper.deleteLeftPrimaryKeyTableMappings(rightPrimaryKey);
061 }
062
063 @Override
064 public boolean deleteTableMapping(long leftPrimaryKey, long rightPrimaryKey)
065 throws SystemException {
066
067 return _tableMapper.deleteTableMapping(rightPrimaryKey, leftPrimaryKey);
068 }
069
070 @Override
071 public void destroy() {
072 _tableMapper.destroy();
073 }
074
075 @Override
076 public List<L> getLeftBaseModels(
077 long rightPrimaryKey, int start, int end, OrderByComparator obc)
078 throws SystemException {
079
080 return _tableMapper.getRightBaseModels(
081 rightPrimaryKey, start, end, obc);
082 }
083
084 @Override
085 public long[] getLeftPrimaryKeys(long rightPrimaryKey)
086 throws SystemException {
087
088 return _tableMapper.getRightPrimaryKeys(rightPrimaryKey);
089 }
090
091 @Override
092 public TableMapper<R, L> getReverseTableMapper() {
093 return _tableMapper;
094 }
095
096 @Override
097 public List<R> getRightBaseModels(
098 long leftPrimaryKey, int start, int end, OrderByComparator obc)
099 throws SystemException {
100
101 return _tableMapper.getLeftBaseModels(leftPrimaryKey, start, end, obc);
102 }
103
104 @Override
105 public long[] getRightPrimaryKeys(long leftPrimaryKey)
106 throws SystemException {
107
108 return _tableMapper.getLeftPrimaryKeys(leftPrimaryKey);
109 }
110
111 @Override
112 public boolean matches(String leftColumnName, String rightColumnName) {
113 return _tableMapper.matches(rightColumnName, leftColumnName);
114 }
115
116 private TableMapper<R, L> _tableMapper;
117
118 }