This commit is contained in:
2026-05-29 10:45:56 +09:00
commit 9d69a95a5b
23 changed files with 610 additions and 0 deletions
@@ -0,0 +1,59 @@
## --------------------------------------------------
## BASE Repository (@NoRepositoryBean) — DB 와 1:1, 매번 재생성 (덮어씀)
## + Concrete( @Repository )는 "없을 때만" 1회 생성 (있으면 보존)
## 경로는 telosys-tools.cfg 의 REPO_BASE_PKG / REPO_CONCRETE_PKG / ENTITY_CONCRETE_PKG 로 결정
## --------------------------------------------------
#if ( $entity.isJoinEntity() )
#cancel("No JPA repository for join entity")
#end
#checkId($entity)
#parse("include/init_var_repo.vm")
#parse("include/java_header.vm")
##---------------------------------------------------------------------------------------
## 경로 계산 : 모두 telosys-tools.cfg 의 변수 기반
## Base -> REPO_BASE_PKG
## Concrete -> REPO_CONCRETE_PKG (없으면 1회 생성)
##---------------------------------------------------------------------------------------
#set( $concretePath = $REPO_CONCRETE_PKG.replace(".", "/") )
#set( $concreteFolder = "${SRC}/${concretePath}" )
#set( $concreteFile = "${concreteFolder}/${repoConcreteClass}.java" )
#if( ! $fn.file($concreteFile).exists() )
$generator.generate($entity.name, "${repoConcreteClass}.java", $concreteFolder, "main-java/XxxRepositoryConcrete_java.vm")
#end
##---------------------------------------------------------------------------------------
package ${REPO_BASE_PKG};
import ${ENTITY_CONCRETE_PKG}.${entityClass};
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;
/**
* BASE repository for "${entityClass}" — generated from DB, DO NOT EDIT (regenerated).
* 커스텀 쿼리는 ${REPO_CONCRETE_PKG}.${repoConcreteClass} 에 작성하세요.
#if( $entity.databaseComment && $entity.databaseComment != "" )
*
* Table comment: ${entity.databaseComment}
#end
*
* <p>주요 컬럼:</p>
* <ul>
#foreach( $attribute in $entity.keyAttributes )
#if( $attribute.databaseComment && $attribute.databaseComment != "" )
* <li>(PK) ${attribute.databaseName} — ${attribute.databaseComment}</li>
#else
* <li>(PK) ${attribute.databaseName}</li>
#end
#end
#foreach( $attribute in $entity.nonKeyAttributes )
#if( $attribute.databaseComment && $attribute.databaseComment != "" )
* <li>${attribute.databaseName} — ${attribute.databaseComment}</li>
#end
#end
* </ul>
*/
@NoRepositoryBean
public interface ${repoBaseClass} extends JpaRepository<${entityClass}, ${pkType}>,
JpaSpecificationExecutor<${entityClass}> {
}
@@ -0,0 +1,17 @@
## --------------------------------------------------
## CONCRETE Repository (@Repository) — "없을 때만" 1회 생성. 재생성해도 보존됨.
## 여기에 커스텀 쿼리 / 메소드를 추가하세요.
## 경로 : telosys-tools.cfg 의 REPO_CONCRETE_PKG
## --------------------------------------------------
#parse("include/init_var_repo.vm")
package ${REPO_CONCRETE_PKG};
import ${REPO_BASE_PKG}.${repoBaseClass};
import org.springframework.stereotype.Repository;
@Repository
public interface ${repoConcreteClass} extends ${repoBaseClass} {
// ================= 커스텀 쿼리 영역 (재생성해도 보존) =================
}