Changed ID data type to Long

This commit is contained in:
Hyojin Ahn 2025-12-02 11:03:16 -05:00
parent dc4c345d35
commit f8b9f86bf3
11 changed files with 15 additions and 15 deletions

View File

@ -9,10 +9,10 @@ import com.goi.erp.employee.EmployeeDetails;
import java.util.Optional;
public class ApplicationAuditAware implements AuditorAware<Integer> {
public class ApplicationAuditAware implements AuditorAware<Long> {
@Override
public Optional<Integer> getCurrentAuditor() {
public Optional<Long> getCurrentAuditor() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication == null ||

View File

@ -53,7 +53,7 @@ public class ApplicationConfig {
}
@Bean
public AuditorAware<Integer> auditorAware() {
public AuditorAware<Long> auditorAware() {
return new ApplicationAuditAware();
}

View File

@ -23,7 +23,7 @@ public class Employee {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "emp_id")
private Integer empId; // 내부 PK, 외부 노출 X
private Long empId; // 내부 PK, 외부 노출 X
@Column(name = "emp_uuid", unique = true, nullable = false)
private UUID empUuid; // 외부 키로 사용
@ -41,7 +41,7 @@ public class Employee {
private String empLastName;
@Column(name = "emp_dept_id")
private Integer empDeptId;
private Long empDeptId;
@Column(name = "emp_status", columnDefinition = "CHAR(1)")
private String empStatus;

View File

@ -30,7 +30,7 @@ public class EmployeeRole {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "emr_id")
private Integer emrId; // 내부 PK
private Long emrId; // 내부 PK
@Column(name = "emr_uuid", unique = true, nullable = false)
private UUID emrUuid; // 외부용 UUID

View File

@ -15,5 +15,5 @@ public interface EmployeeRoleRepository extends JpaRepository<EmployeeRole, Inte
WHERE er.employee.id = :empId
AND er.emrRevokedAt IS NULL
""")
List<EmployeeRole> findActiveRolesByEmployeeId(Integer empId);
List<EmployeeRole> findActiveRolesByEmployeeId(Long empId);
}

View File

@ -26,7 +26,7 @@ public class PermissionInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "perm_id")
private Integer permId;
private Long permId;
@Column(name = "perm_uuid", nullable = false, updatable = false)
private UUID permUuid;

View File

@ -28,7 +28,7 @@ public class RoleInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "role_id")
private Integer roleId;
private Long roleId;
@Column(name = "role_uuid", unique = true, nullable = false)
private UUID roleUuid;

View File

@ -27,7 +27,7 @@ public class RolePermission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "rpr_id")
private Integer id;
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "rpr_role_id", nullable = false)

View File

@ -12,7 +12,7 @@ public interface RolePermissionRepository extends JpaRepository<RolePermission,
// 특정 Role의 모든 권한 조회
@Query("SELECT r FROM RolePermission r WHERE r.roleInfo.id = :roleId")
List<RolePermission> findByRoleId(@Param("roleId") Integer roleId);
List<RolePermission> findByRoleId(@Param("roleId") Long roleId);
// Role과 Permission 매핑 존재 여부 확인
@Query("""
@ -21,6 +21,6 @@ public interface RolePermissionRepository extends JpaRepository<RolePermission,
WHERE r.roleInfo.id = :roleId
AND r.permissionInfo.id = :permId
""")
boolean existsByRoleInfoAndPermissionInfo(@Param("roleId") Integer roleId,
@Param("permId") Integer permId);
boolean existsByRoleInfoAndPermissionInfo(@Param("roleId") Long roleId,
@Param("permId") Long permId);
}

View File

@ -29,7 +29,7 @@ public class Token {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "emt_id")
private Integer id;
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "emt_emp_id", nullable = false)

View File

@ -14,7 +14,7 @@ public interface TokenRepository extends JpaRepository<Token, Integer> {
where t.employee.id = :employeeId
and (t.expired = false or t.revoked = false)
""")
List<Token> findAllValidTokenByEmployee(Integer employeeId);
List<Token> findAllValidTokenByEmployee(Long employeeId);
Optional<Token> findByToken(String token);