Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.datasource.driver-class-name=com.mysql.jdbc.Driver
- spring.datasource.url=jdbc:mysql://xx.xx.xx.xx:3306/dbA?useSSL=false
- spring.datasource.username=username
- spring.datasource.password=password
- spring.jpa.hibernate.ddl-auto=update
- spring.jpa.show-sql=true
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
- spring.DSB.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
- # Enable to auto identify each datasource
- spring.jpa.database=default
- import java.util.List;
- import javax.persistence.EntityManager;
- import javax.persistence.PersistenceContext;
- import org.springframework.stereotype.Repository;
- @Repository
- public class ClassDaoDSA {
- @PersistenceContext
- private EntityManager manager;
- public List<T> Records() {
- String stmt = "SELECT d FROM Data d ORDER BY d.id DESC";
- return manager.createQuery(stmt).getResultList();
- }
- }
Add Comment
Please, Sign In to add comment