table2pojo icon indicating copy to clipboard operation
table2pojo copied to clipboard

create Entity and Repository files for Hibernate

Open skaros opened this issue 4 years ago • 1 comments

Since I took a look on your code, I changed it a bit to create an empty Repository file with each Entity file created. For example if a table "testTable1" is found, I changed your code in order to create the POJO file with name testTable1Entity.java and I create a file called testTable1Repository.java like this

import org.springframework.data.jpa.repository.JpaRepository; 
import org.springframework.stereotype.Repository;

@Repository
public interface CompaniesRepository extends JpaRepository<"+tableName+"Entity, Long> {

}

This is the first Hibernate project I am working on, so I am not sure if this is a good practice, and I haven't even tested that this would help.

skaros avatar Sep 08 '21 05:09 skaros

@skaros thanks for the suggestion. yes, we can add these additional statements via custom CLI args.

for an example, -s will add these statements conditionally to POJOs.

kumarvv avatar Sep 09 '21 18:09 kumarvv