Does anyone have a guide or github example of setting up JPA in CAS 6.3.x?
I'm trying to get the spring-boot way to work but I keep getting various errors with missing beans, undefined jpa data models etc. All works with standalone spring-boot2 app but not working out with cas template project.
build.gradle:
implementation ("org.springframework.boot:spring-boot-starter-data-jpa:2.3.9.RELEASE") {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.apache.tomcat', module: 'tomcat-jdbc'
}
@Data
@RequiredArgsConstructor
@NoArgsConstructor(access=AccessLevel.PRIVATE, force=true)
@Entity
public class MyUser implements Serializable {
@Id
private final String userId;
...
}
@Repository
public interface MyUserRepository extends JpaRepository<
MyUser , String> {...}
@Service
@Transactional(readOnly = true)
public class MyUserService {
@Autowired
private
MyUserRepository myUserRepository ;
@Transactional(readOnly = true)
public
MyUser findByUserId(String id) {
return
myUserRepository.findByUserId(id);
}
}
Thanks in advance
-psv