mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	Part1 - Move common operations to EntityRepository class
This commit is contained in:
		
							parent
							
								
									1f8b7a99c6
								
							
						
					
					
						commit
						906fc5ee67
					
				| @ -46,11 +46,14 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class ChartRepositoryHelper implements EntityRepository<Chart>{ | ||||
| public class ChartRepositoryHelper extends EntityRepository<Chart>{ | ||||
|   private static final Fields CHART_UPDATE_FIELDS = new Fields(ChartResource.FIELD_LIST, "owner"); | ||||
|   private static final Fields CHART_PATCH_FIELDS = new Fields(ChartResource.FIELD_LIST, "owner,service,tags"); | ||||
| 
 | ||||
|   public ChartRepositoryHelper(ChartRepository3 chartRepo) { this.repo3 = chartRepo; } | ||||
|   public ChartRepositoryHelper(ChartRepository3 repo3) { | ||||
|     super(repo3.chartDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final ChartRepository3 repo3; | ||||
| 
 | ||||
| @ -193,21 +196,6 @@ public class ChartRepositoryHelper implements EntityRepository<Chart>{ | ||||
|     return repo3.chartDAO().findEntityById(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Chart entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -49,13 +49,16 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class DashboardRepositoryHelper implements EntityRepository<Dashboard> { | ||||
| public class DashboardRepositoryHelper extends EntityRepository<Dashboard> { | ||||
|   private static final Fields DASHBOARD_UPDATE_FIELDS = new Fields(DashboardResource.FIELD_LIST, | ||||
|           "owner,service,tags,charts"); | ||||
|   private static final Fields DASHBOARD_PATCH_FIELDS = new Fields(DashboardResource.FIELD_LIST, | ||||
|           "owner,service,tags,charts"); | ||||
| 
 | ||||
|   public DashboardRepositoryHelper(DashboardRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public DashboardRepositoryHelper(DashboardRepository3 repo3) { | ||||
|     super(repo3.dashboardDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final DashboardRepository3 repo3; | ||||
| 
 | ||||
| @ -63,28 +66,14 @@ public class DashboardRepositoryHelper implements EntityRepository<Dashboard> { | ||||
|     return (dashboard.getService().getName() + "." + dashboard.getName()); | ||||
|   } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|       return repo3.dashboardDAO().listAfter(fqnPrefix, limitParam, after); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|       return repo3.dashboardDAO().listBefore(fqnPrefix, limitParam, before); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int listCount(String fqnPrefix) { | ||||
|       return repo3.dashboardDAO().listCount(fqnPrefix); | ||||
|     } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Dashboard entity) { | ||||
|     return entity.getFullyQualifiedName(); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|     public ResultList<Dashboard> getResultList(List<Dashboard> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException { | ||||
|   public ResultList<Dashboard> getResultList(List<Dashboard> entities, String beforeCursor, String afterCursor, | ||||
|                                              int total) throws GeneralSecurityException, UnsupportedEncodingException { | ||||
|     return new DashboardList(entities, beforeCursor, afterCursor, total); | ||||
|   } | ||||
| 
 | ||||
| @ -146,7 +135,8 @@ public class DashboardRepositoryHelper implements EntityRepository<Dashboard> { | ||||
|   @Transaction | ||||
|   public Status addFollower(String dashboardId, String userId) throws IOException { | ||||
|     repo3.dashboardDAO().findEntityById(dashboardId); | ||||
|     return EntityUtil.addFollower(repo3.relationshipDAO(), repo3.userDAO(), dashboardId, Entity.DASHBOARD, userId, Entity.USER) ? | ||||
|     return EntityUtil.addFollower(repo3.relationshipDAO(), repo3.userDAO(), dashboardId, Entity.DASHBOARD, userId, | ||||
|             Entity.USER) ? | ||||
|             Status.CREATED : Status.OK; | ||||
|   } | ||||
| 
 | ||||
| @ -260,7 +250,8 @@ public class DashboardRepositoryHelper implements EntityRepository<Dashboard> { | ||||
|   } | ||||
| 
 | ||||
|   private List<EntityReference> getFollowers(Dashboard dashboard) throws IOException { | ||||
|     return dashboard == null ? null : EntityUtil.getFollowers(dashboard.getId(), repo3.relationshipDAO(), repo3.userDAO()); | ||||
|     return dashboard == null ? null : EntityUtil.getFollowers(dashboard.getId(), repo3.relationshipDAO(), | ||||
|             repo3.userDAO()); | ||||
|   } | ||||
| 
 | ||||
|   private List<Chart> getCharts(Dashboard dashboard) throws IOException { | ||||
| @ -380,7 +371,8 @@ public class DashboardRepositoryHelper implements EntityRepository<Dashboard> { | ||||
|     final Dashboard updated; | ||||
| 
 | ||||
|     public DashboardUpdater(Dashboard orig, Dashboard updated, boolean patchOperation) { | ||||
|       super(new DashboardEntityInterface(orig), new DashboardEntityInterface(updated), patchOperation, repo3.relationshipDAO(), | ||||
|       super(new DashboardEntityInterface(orig), new DashboardEntityInterface(updated), patchOperation, | ||||
|               repo3.relationshipDAO(), | ||||
|               repo3.tagDAO()); | ||||
|       this.orig = orig; | ||||
|       this.updated = updated; | ||||
|  | ||||
| @ -37,11 +37,14 @@ import java.util.List; | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| 
 | ||||
| public class DashboardServiceRepositoryHelper implements EntityRepository<DashboardService> { | ||||
|   public DashboardServiceRepositoryHelper(DashboardServiceRepository3 repo3) { this.repo3 = repo3; } | ||||
| 
 | ||||
| public class DashboardServiceRepositoryHelper extends EntityRepository<DashboardService> { | ||||
|   private final DashboardServiceRepository3 repo3; | ||||
| 
 | ||||
|   public DashboardServiceRepositoryHelper(DashboardServiceRepository3 repo3) { | ||||
|     super(repo3.dashboardServiceDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   @Transaction | ||||
|   public List<DashboardService> list(String name) throws IOException { | ||||
|     return JsonUtils.readObjects(repo3.dashboardServiceDAO().list(name), DashboardService.class); | ||||
| @ -85,21 +88,6 @@ public class DashboardServiceRepositoryHelper implements EntityRepository<Dashbo | ||||
|     repo3.relationshipDAO().deleteAll(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return repo3.dashboardServiceDAO().listAfter(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return repo3.dashboardServiceDAO().listBefore(fqnPrefix, limitParam, before); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return repo3.dashboardServiceDAO().listCount(fqnPrefix); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(DashboardService entity) { | ||||
|     // TODO clean this up | ||||
|  | ||||
| @ -51,13 +51,14 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class DatabaseRepositoryHelper implements EntityRepository<Database> { | ||||
| public class DatabaseRepositoryHelper extends EntityRepository<Database> { | ||||
|   private static final Logger LOG = LoggerFactory.getLogger(DatabaseRepositoryHelper.class); | ||||
|   private static final Fields DATABASE_UPDATE_FIELDS = new Fields(DatabaseResource.FIELD_LIST, "owner"); | ||||
|   private static final Fields DATABASE_PATCH_FIELDS = new Fields(DatabaseResource.FIELD_LIST, | ||||
|           "owner,service, usageSummary"); | ||||
| 
 | ||||
|   public DatabaseRepositoryHelper(DatabaseRepository3 repo3) { | ||||
|     super(repo3.databaseDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
| @ -216,21 +217,6 @@ public class DatabaseRepositoryHelper implements EntityRepository<Database> { | ||||
|     return tables; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return repo3.databaseDAO().listAfter(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return repo3.databaseDAO().listBefore(fqnPrefix, limitParam, before); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return repo3.databaseDAO().listCount(fqnPrefix); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Database entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -37,11 +37,15 @@ import java.util.List; | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| 
 | ||||
| public class DatabaseServiceRepositoryHelper implements EntityRepository<DatabaseService> { | ||||
|   public DatabaseServiceRepositoryHelper(DatabaseServiceRepository3 repo3) { this.repo3 = repo3; } | ||||
| 
 | ||||
| public class DatabaseServiceRepositoryHelper extends EntityRepository<DatabaseService> { | ||||
|   private final DatabaseServiceRepository3 repo3; | ||||
| 
 | ||||
|   public DatabaseServiceRepositoryHelper(DatabaseServiceRepository3 repo3) { | ||||
|     super(repo3.dbServiceDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   @Transaction | ||||
|   public List<DatabaseService> list(String name) throws IOException { | ||||
|     return JsonUtils.readObjects(repo3.dbServiceDAO().list(name), DatabaseService.class); | ||||
| @ -83,21 +87,6 @@ public class DatabaseServiceRepositoryHelper implements EntityRepository<Databas | ||||
|     repo3.relationshipDAO().deleteAll(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(DatabaseService entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -13,21 +13,35 @@ import java.util.List; | ||||
|  * Interface used for accessing the concrete entity DAOs such as table, dashboard etc. | ||||
|  * This gives a uniform access so that common boiler plate code can be reduced. | ||||
|  */ | ||||
| public interface EntityRepository<T> { | ||||
| public abstract class EntityRepository<T> { | ||||
|   private final EntityDAO<T> dao; | ||||
| 
 | ||||
|   EntityRepository(EntityDAO<T> entityDAO) { | ||||
|     this.dao = entityDAO; | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|    * DAO related operations | ||||
|    */ | ||||
|   List<String> listAfter(String fqnPrefix, int limitParam, String after); | ||||
|   List<String> listBefore(String fqnPrefix, int limitParam, String before); | ||||
|   int listCount(String fqnPrefix); | ||||
|   public final List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return dao.listAfter(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   public final List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return dao.listBefore(fqnPrefix, limitParam, before); | ||||
|   } | ||||
| 
 | ||||
|   public final int listCount(String fqnPrefix) { | ||||
|     return dao.listCount(fqnPrefix); | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|    * Entity related operations | ||||
|    */ | ||||
|   String getFullyQualifiedName(T entity); | ||||
|   T setFields(T entity, Fields fields) throws IOException, ParseException; | ||||
|   public abstract String getFullyQualifiedName(T entity); | ||||
| 
 | ||||
|   ResultList<T> getResultList(List<T> entities, String beforeCursor, String afterCursor, | ||||
|   public abstract T setFields(T entity, Fields fields) throws IOException, ParseException; | ||||
| 
 | ||||
|   public abstract ResultList<T> getResultList(List<T> entities, String beforeCursor, String afterCursor, | ||||
|                                      int total) throws GeneralSecurityException, UnsupportedEncodingException; | ||||
| } | ||||
|  | ||||
| @ -36,11 +36,14 @@ import java.util.List; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class MessagingServiceRepositoryHelper implements EntityRepository<MessagingService> { | ||||
|   public MessagingServiceRepositoryHelper(MessagingServiceRepository3 repo3) { this.repo3 = repo3; } | ||||
| 
 | ||||
| public class MessagingServiceRepositoryHelper extends EntityRepository<MessagingService> { | ||||
|   private final MessagingServiceRepository3 repo3; | ||||
| 
 | ||||
|   public MessagingServiceRepositoryHelper(MessagingServiceRepository3 repo3) { | ||||
|     super(repo3.messagingServiceDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   @Transaction | ||||
|   public List<MessagingService> list(String name) throws IOException { | ||||
|     return JsonUtils.readObjects(repo3.messagingServiceDAO().list(name), MessagingService.class); | ||||
| @ -85,21 +88,6 @@ public class MessagingServiceRepositoryHelper implements EntityRepository<Messag | ||||
|     repo3.relationshipDAO().deleteAll(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(MessagingService entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -39,10 +39,13 @@ import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.UUID; | ||||
| 
 | ||||
| public class MetricsRepositoryHelper implements EntityRepository<Metrics> { | ||||
| public class MetricsRepositoryHelper extends EntityRepository<Metrics> { | ||||
|   private static final Fields METRICS_UPDATE_FIELDS = new Fields(MetricsResource.FIELD_LIST, "owner,service"); | ||||
| 
 | ||||
|   public MetricsRepositoryHelper(MetricsRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public MetricsRepositoryHelper(MetricsRepository3 repo3) { | ||||
|     super(repo3.metricsDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final MetricsRepository3 repo3; | ||||
| 
 | ||||
| @ -85,21 +88,6 @@ public class MetricsRepositoryHelper implements EntityRepository<Metrics> { | ||||
|     return metricsList; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return repo3.metricsDAO().listAfter(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return repo3.metricsDAO().listBefore(fqnPrefix, limitParam, before); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return repo3.metricsDAO().listCount(fqnPrefix); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Metrics entity) { | ||||
|     return entity.getFullyQualifiedName(); | ||||
|  | ||||
| @ -48,14 +48,17 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class ModelRepositoryHelper implements EntityRepository<Model> { | ||||
| public class ModelRepositoryHelper extends EntityRepository<Model> { | ||||
|   private static final Logger LOG = LoggerFactory.getLogger(ModelRepositoryHelper.class); | ||||
|   private static final Fields MODEL_UPDATE_FIELDS = new Fields(ModelResource.FIELD_LIST, | ||||
|           "owner,dashboard,tags"); | ||||
|   private static final Fields MODEL_PATCH_FIELDS = new Fields(ModelResource.FIELD_LIST, | ||||
|           "owner,dashboard,tags"); | ||||
| 
 | ||||
|   public ModelRepositoryHelper(ModelRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public ModelRepositoryHelper(ModelRepository3 repo3) { | ||||
|     super(repo3.modelDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final ModelRepository3 repo3; | ||||
| 
 | ||||
| @ -176,21 +179,6 @@ public class ModelRepositoryHelper implements EntityRepository<Model> { | ||||
|     return setFields(repo3.modelDAO().findEntityById(id), fields); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Model entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -48,13 +48,16 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class PipelineRepositoryHelper implements EntityRepository<Pipeline> { | ||||
| public class PipelineRepositoryHelper extends EntityRepository<Pipeline> { | ||||
|   private static final Fields PIPELINE_UPDATE_FIELDS = new Fields(PipelineResource.FIELD_LIST, | ||||
|           "owner,service,tags,tasks"); | ||||
|   private static final Fields PIPELINE_PATCH_FIELDS = new Fields(PipelineResource.FIELD_LIST, | ||||
|           "owner,service,tags,tasks"); | ||||
| 
 | ||||
|   public PipelineRepositoryHelper(PipelineRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public PipelineRepositoryHelper(PipelineRepository3 repo3) { | ||||
|     super(repo3.pipelineDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final PipelineRepository3 repo3; | ||||
| 
 | ||||
| @ -194,21 +197,6 @@ public class PipelineRepositoryHelper implements EntityRepository<Pipeline> { | ||||
|     return setFields(repo3.pipelineDAO().findEntityById(id), fields); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Pipeline entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -39,10 +39,13 @@ import java.util.List; | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| 
 | ||||
| public class PipelineServiceRepositoryHelper implements EntityRepository<PipelineService> { | ||||
| public class PipelineServiceRepositoryHelper extends EntityRepository<PipelineService> { | ||||
|   private static final Logger LOG = LoggerFactory.getLogger(PipelineServiceRepositoryHelper.class); | ||||
| 
 | ||||
|   public PipelineServiceRepositoryHelper(PipelineServiceRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public PipelineServiceRepositoryHelper(PipelineServiceRepository3 repo3) { | ||||
|     super(repo3.pipelineServiceDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final PipelineServiceRepository3 repo3; | ||||
| 
 | ||||
| @ -90,22 +93,6 @@ public class PipelineServiceRepositoryHelper implements EntityRepository<Pipelin | ||||
|     repo3.relationshipDAO().deleteAll(id); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(PipelineService entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -35,10 +35,13 @@ import java.security.GeneralSecurityException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| public class ReportRepositoryHelper implements EntityRepository<Report>{ | ||||
| public class ReportRepositoryHelper extends EntityRepository<Report>{ | ||||
|   private static final Fields REPORT_UPDATE_FIELDS = new Fields(ReportResource.FIELD_LIST, "owner,service"); | ||||
| 
 | ||||
|   public ReportRepositoryHelper(ReportRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public ReportRepositoryHelper(ReportRepository3 repo3) { | ||||
|     super(repo3.reportDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final ReportRepository3 repo3; | ||||
| 
 | ||||
| @ -88,21 +91,6 @@ public class ReportRepositoryHelper implements EntityRepository<Report>{ | ||||
|     return reportList; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Report entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -71,7 +71,7 @@ import java.util.UUID; | ||||
| import static org.openmetadata.catalog.jdbi3.Relationship.JOINED_WITH; | ||||
| import static org.openmetadata.common.utils.CommonUtil.parseDate; | ||||
| 
 | ||||
| public class TableRepositoryHelper implements EntityRepository<Table> { | ||||
| public class TableRepositoryHelper extends EntityRepository<Table> { | ||||
|   static final Logger LOG = LoggerFactory.getLogger(TableRepositoryHelper.class); | ||||
|   // Table fields that can be patched in a PATCH request | ||||
|   static final Fields TABLE_PATCH_FIELDS = new Fields(TableResource.FIELD_LIST, | ||||
| @ -80,25 +80,13 @@ public class TableRepositoryHelper implements EntityRepository<Table> { | ||||
|   static final Fields TABLE_UPDATE_FIELDS = new Fields(TableResource.FIELD_LIST, | ||||
|           "owner,columns,database,tags,tableConstraints"); | ||||
| 
 | ||||
|   public TableRepositoryHelper(TableRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public TableRepositoryHelper(TableRepository3 repo3) { | ||||
|     super(repo3.tableDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final TableRepository3 repo3; | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return repo3.tableDAO().listAfter(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String after) { | ||||
|     return repo3.tableDAO().listBefore(fqnPrefix, limitParam, after); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return repo3.tableDAO().listCount(fqnPrefix); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Table entity) { | ||||
|     return entity.getFullyQualifiedName(); | ||||
|  | ||||
| @ -48,7 +48,7 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class TaskRepositoryHelper implements EntityRepository<Task>{ | ||||
| public class TaskRepositoryHelper extends EntityRepository<Task>{ | ||||
|   private static final Fields TASK_UPDATE_FIELDS = new Fields(TaskResource.FIELD_LIST, "owner," + | ||||
|           "taskConfig,tags,downstreamTasks"); | ||||
|   private static final Fields TASK_PATCH_FIELDS = new Fields(TaskResource.FIELD_LIST, "owner,service,tags"); | ||||
| @ -57,7 +57,10 @@ public class TaskRepositoryHelper implements EntityRepository<Task>{ | ||||
|     return (task.getService().getName() + "." + task.getName()); | ||||
|   } | ||||
| 
 | ||||
|   public TaskRepositoryHelper(TaskRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public TaskRepositoryHelper(TaskRepository3 repo3) { | ||||
|     super(repo3.taskDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final TaskRepository3 repo3; | ||||
| 
 | ||||
| @ -226,21 +229,6 @@ public class TaskRepositoryHelper implements EntityRepository<Task>{ | ||||
|     return repo3.taskDAO().findEntityById(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Task entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -47,10 +47,13 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.jdbi3.Relationship.OWNS; | ||||
| 
 | ||||
| public class TeamRepositoryHelper implements EntityRepository<Team> { | ||||
| public class TeamRepositoryHelper extends EntityRepository<Team> { | ||||
|   static final Fields TEAM_PATCH_FIELDS = new Fields(TeamResource.FIELD_LIST, "profile,users"); | ||||
| 
 | ||||
|   public TeamRepositoryHelper(TeamRepository3 repo3) { this.repo3 = repo3; } | ||||
|   public TeamRepositoryHelper(TeamRepository3 repo3) { | ||||
|     super(repo3.teamDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final TeamRepository3 repo3; | ||||
| 
 | ||||
| @ -194,21 +197,6 @@ public class TeamRepositoryHelper implements EntityRepository<Team> { | ||||
|     return users; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Team entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -49,7 +49,7 @@ import java.util.UUID; | ||||
| 
 | ||||
| import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound; | ||||
| 
 | ||||
| public class TopicRepositoryHelper implements EntityRepository<Topic> { | ||||
| public class TopicRepositoryHelper extends EntityRepository<Topic> { | ||||
|   private static final Logger LOG = LoggerFactory.getLogger(TopicRepositoryHelper.class); | ||||
|   private static final Fields TOPIC_UPDATE_FIELDS = new Fields(TopicResource.FIELD_LIST, "owner,tags"); | ||||
|   private static final Fields TOPIC_PATCH_FIELDS = new Fields(TopicResource.FIELD_LIST, "owner,service,tags"); | ||||
| @ -58,8 +58,9 @@ public class TopicRepositoryHelper implements EntityRepository<Topic> { | ||||
|     return (topic.getService().getName() + "." + topic.getName()); | ||||
|   } | ||||
| 
 | ||||
|   public TopicRepositoryHelper(TopicRepository3 topicRepository3) { | ||||
|     this.repo3 = topicRepository3; | ||||
|   public TopicRepositoryHelper(TopicRepository3 repo3) { | ||||
|     super(repo3.topicDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   private final TopicRepository3 repo3; | ||||
| @ -201,21 +202,6 @@ public class TopicRepositoryHelper implements EntityRepository<Topic> { | ||||
|     return repo3.topicDAO().findEntityById(id); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(Topic entity) { | ||||
|     return null; | ||||
|  | ||||
| @ -54,15 +54,19 @@ import static org.openmetadata.catalog.jdbi3.Relationship.CONTAINS; | ||||
| import static org.openmetadata.catalog.jdbi3.Relationship.FOLLOWS; | ||||
| import static org.openmetadata.catalog.jdbi3.Relationship.OWNS; | ||||
| 
 | ||||
| public class UserRepositoryHelper implements EntityRepository<User> { | ||||
| public class UserRepositoryHelper extends EntityRepository<User> { | ||||
|   public static final Logger LOG = LoggerFactory.getLogger(UserRepositoryHelper.class); | ||||
|   static final Fields USER_PATCH_FIELDS = new Fields(UserResource.FIELD_LIST, "profile,teams"); | ||||
|   static final Fields USER_UPDATE_FIELDS = new Fields(UserResource.FIELD_LIST, "profile,teams"); | ||||
| 
 | ||||
|   public UserRepositoryHelper(UserRepository3 repo3) { this.repo3 = repo3; } | ||||
| 
 | ||||
|   private final UserRepository3 repo3; | ||||
| 
 | ||||
| 
 | ||||
|   public UserRepositoryHelper(UserRepository3 repo3) { | ||||
|     super(repo3.userDAO()); | ||||
|     this.repo3 = repo3; | ||||
|   } | ||||
| 
 | ||||
|   public static List<EntityReference> toEntityReference(List<Team> teams) { | ||||
|     if (teams == null) { | ||||
|       return null; | ||||
| @ -186,21 +190,6 @@ public class UserRepositoryHelper implements EntityRepository<User> { | ||||
|     userUpdater.store(); | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listAfter(String fqnPrefix, int limitParam, String after) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public List<String> listBefore(String fqnPrefix, int limitParam, String before) { | ||||
|     return null; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public int listCount(String fqnPrefix) { | ||||
|     return 0; | ||||
|   } | ||||
| 
 | ||||
|   @Override | ||||
|   public String getFullyQualifiedName(User entity) { | ||||
|     return null; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 sureshms
						sureshms