Skip to content

Commit

Permalink
EPMRPP-88736 implement dao for analytics data
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Jun 26, 2024
1 parent b0e00d6 commit e239b4d
Show file tree
Hide file tree
Showing 11 changed files with 562 additions and 2 deletions.
3 changes: 2 additions & 1 deletion project-properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project.ext {
releaseMode = project.hasProperty("releaseMode")
hasDBSchema = project.hasProperty("DB_SCHEMA_POSTGRES")
scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'develop')
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop')
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'EPMRPP-88736')

//TODO refactor with archive download
testScriptsSrc = [
Expand Down Expand Up @@ -84,6 +84,7 @@ project.ext {
(migrationsUrl + '/migrations/84_organization_tables.up.sql') : 'V084__organization_tables.sql',
(migrationsUrl + '/migrations/86_notication_update.up.sql') : 'V086__notication_update.sql',
(migrationsUrl + '/migrations/88_add_retention_policy_launch.up.sql') : 'V088__add_retention_policy_launch.sql',
(migrationsUrl + '/migrations/90_analytics_data_table.up.sql') : 'V090__analytics_data_table.sql',

]
excludeTests = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.ta.reportportal.dao;

import org.springframework.stereotype.Repository;
import com.epam.ta.reportportal.entity.analytics.AnalyticsData;

@Repository
public interface AnalyticsDataRepository extends ReportPortalRepository<AnalyticsData, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.ta.reportportal.entity.analytics;

import com.epam.ta.reportportal.entity.Metadata;
import java.io.Serializable;
import java.time.Instant;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.springframework.data.annotation.CreatedDate;

/**
* @author Siarhei Hrabko
*/
@Entity
@TypeDef(name = "meta", typeClass = Metadata.class)
@Table(name = "analytics_data", schema = "public")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class AnalyticsData implements Serializable {

private static final long serialVersionUID = 923392982L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false, precision = 64)
private Long id;

@Column(name = "type")
private String type;

@Column(name = "metadata")
@Type(type = "meta")
private Metadata metadata;

@Column(name = "created_at", nullable = false)
@CreatedDate
private Instant createdAt;

}
3 changes: 3 additions & 0 deletions src/main/java/com/epam/ta/reportportal/jooq/Indexes.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/main/java/com/epam/ta/reportportal/jooq/JPublic.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/java/com/epam/ta/reportportal/jooq/Keys.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/main/java/com/epam/ta/reportportal/jooq/Sequences.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/java/com/epam/ta/reportportal/jooq/Tables.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e239b4d

Please sign in to comment.