table2pojo
table2pojo copied to clipboard
create Entity and Repository files for Hibernate
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 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.