added jpa entity generator
parent
6fb8e9b59f
commit
77c3e7e96a
|
@ -6,9 +6,11 @@ const jpaEntites = require('../java-jpa-entity');
|
|||
|
||||
const templateEntities = fs.readFileSync(path.resolve(path.join('templates', 'jpa-entity.java.mustache')), 'utf-8')
|
||||
const templaterepository = fs.readFileSync(path.resolve(path.join('templates', 'jpa-repository.java.mustache')), 'utf-8')
|
||||
const templaterepositoryPagination = fs.readFileSync(path.resolve(path.join('templates', 'jpa-paginated-repository.java.mustache')), 'utf-8')
|
||||
|
||||
function getRepositoryTemplate(type) {
|
||||
switch(type) {
|
||||
case 'pageable': return templaterepositoryPagination;
|
||||
default: return templaterepository;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Auto-generated from apibuilder.io service specification.
|
||||
* apidoc-version : {{service.apidoc.version}}
|
||||
* organisation : {{service.organization.key}}
|
||||
* service-version : {{service.version}}
|
||||
*
|
||||
* Documentation at:
|
||||
* <a href="https://app.apibuilder.io/{{service.organization.key}}/{{service.name}}/{{service.version}}">https://app.apibuilder.io/{{service.organization.key}}/{{service.name}}/{{service.version}}</a>
|
||||
*
|
||||
**/
|
||||
package {{package}};
|
||||
|
||||
|
||||
import lombok.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
{{#imports}}
|
||||
import {{{.}}};
|
||||
{{/imports}}
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
public interface {{record_type}}Repository extends PagingAndSortingRepository<{{pkey_type.name}}, {{record_type}}> {
|
||||
|
||||
{{#indexes}}
|
||||
List<{{record_type}}> findAllBy{{namePascalCase}}(@NonNull {{type.name}} {{name}}, Pageable pagination);
|
||||
{{/indexes}}
|
||||
|
||||
}
|
Loading…
Reference in New Issue