Skip to content

Commit

Permalink
BIGTOP-4176: Rename ORM entities (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinw66 authored Aug 1, 2024
1 parent e32813a commit 8724fac
Show file tree
Hide file tree
Showing 92 changed files with 833 additions and 817 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -41,7 +41,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class AuditLog extends BaseEntity {
public class AuditLogPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "audit_log_generator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
Expand All @@ -34,7 +34,7 @@
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseEntity {
public abstract class BasePO {

@CreatedDate
@Column(name = "create_time", updatable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.MaintainState;

Expand Down Expand Up @@ -53,7 +53,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class Cluster extends BaseEntity {
public class ClusterPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "cluster_generator")
Expand Down Expand Up @@ -86,5 +86,5 @@ public class Cluster extends BaseEntity {

@ManyToOne
@JoinColumn(name = "stack_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Stack stack;
private StackPO stackPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -57,7 +57,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class Component extends BaseEntity {
public class ComponentPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "component_generator")
Expand Down Expand Up @@ -86,9 +86,9 @@ public class Component extends BaseEntity {

@ManyToOne
@JoinColumn(name = "service_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Service service;
private ServicePO servicePO;

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.MaintainState;

Expand Down Expand Up @@ -50,7 +50,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class HostComponent extends BaseEntity {
public class HostComponentPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "host_component_generator")
Expand All @@ -62,9 +62,9 @@ public class HostComponent extends BaseEntity {

@ManyToOne
@JoinColumn(name = "host_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Host host;
private HostPO hostPO;

@ManyToOne
@JoinColumn(name = "component_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Component component;
private ComponentPO componentPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.MaintainState;

Expand Down Expand Up @@ -49,7 +49,7 @@
},
indexes = {@Index(name = "idx_host_cluster_id", columnList = "cluster_id")})
@TableGenerator(name = "host_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Host extends BaseEntity {
public class HostPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "host_generator")
Expand Down Expand Up @@ -91,5 +91,5 @@ public class Host extends BaseEntity {

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.JobState;

Expand Down Expand Up @@ -49,7 +49,7 @@
name = "\"job\"",
indexes = {@Index(name = "idx_job_cluster_id", columnList = "cluster_id")})
@TableGenerator(name = "job_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Job extends BaseEntity {
public class JobPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "job_generator")
Expand All @@ -69,9 +69,9 @@ public class Job extends BaseEntity {

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;

@ToString.Exclude
@OneToMany(mappedBy = "job")
private List<Stage> stages;
@OneToMany(mappedBy = "jobPO")
private List<StagePO> stagePOList;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -47,7 +47,7 @@
},
indexes = {@Index(name = "idx_repo_cluster_id", columnList = "cluster_id")})
@TableGenerator(name = "repo_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Repo extends BaseEntity {
public class RepoPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "repo_generator")
Expand All @@ -71,5 +71,5 @@ public class Repo extends BaseEntity {

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -51,7 +51,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class ServiceConfig extends BaseEntity {
public class ServiceConfigPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "service_config_generator")
Expand All @@ -68,14 +68,14 @@ public class ServiceConfig extends BaseEntity {
private Boolean selected;

@ToString.Exclude
@OneToMany(mappedBy = "serviceConfig")
private List<TypeConfig> configs;
@OneToMany(mappedBy = "serviceConfigPO")
private List<TypeConfigPO> configs;

@ManyToOne
@JoinColumn(name = "service_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Service service;
private ServicePO servicePO;

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -51,7 +51,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class Service extends BaseEntity {
public class ServicePO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "service_generator")
Expand Down Expand Up @@ -84,5 +84,5 @@ public class Service extends BaseEntity {

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -41,7 +41,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class Setting extends BaseEntity {
public class SettingPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "settings_generator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -41,7 +41,7 @@
columnNames = {"stack_name", "stack_version"})
})
@TableGenerator(name = "stack_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Stack extends BaseEntity {
public class StackPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "stack_generator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.JobState;

Expand Down Expand Up @@ -52,7 +52,7 @@
@Index(name = "idx_stage_job_id", columnList = "job_id")
})
@TableGenerator(name = "stage_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Stage extends BaseEntity {
public class StagePO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "stage_generator")
Expand Down Expand Up @@ -81,13 +81,13 @@ public class Stage extends BaseEntity {

@ManyToOne
@JoinColumn(name = "job_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Job job;
private JobPO jobPO;

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;

@ToString.Exclude
@OneToMany(mappedBy = "stage")
private List<Task> tasks;
@OneToMany(mappedBy = "stagePO")
private List<TaskPO> taskPOList;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import org.apache.bigtop.manager.common.enums.Command;
import org.apache.bigtop.manager.common.enums.JobState;
Expand Down Expand Up @@ -51,7 +51,7 @@
@Index(name = "idx_task_stage_id", columnList = "stage_id")
})
@TableGenerator(name = "task_generator", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_count")
public class Task extends BaseEntity {
public class TaskPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "task_generator")
Expand Down Expand Up @@ -109,13 +109,13 @@ public class Task extends BaseEntity {

@ManyToOne
@JoinColumn(name = "job_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Job job;
private JobPO jobPO;

@ManyToOne
@JoinColumn(name = "stage_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Stage stage;
private StagePO stagePO;

@ManyToOne
@JoinColumn(name = "cluster_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Cluster cluster;
private ClusterPO clusterPO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.bigtop.manager.dao.entity;
package org.apache.bigtop.manager.dao.po;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -45,7 +45,7 @@
table = "sequence",
pkColumnName = "seq_name",
valueColumnName = "seq_count")
public class TypeConfig extends BaseEntity {
public class TypeConfigPO extends BasePO {

@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "type_config_generator")
Expand All @@ -62,5 +62,5 @@ public class TypeConfig extends BaseEntity {

@ManyToOne
@JoinColumn(name = "service_config_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private ServiceConfig serviceConfig;
private ServiceConfigPO serviceConfigPO;
}
Loading

0 comments on commit 8724fac

Please sign in to comment.