Getting Error while create Dynamic query in spring boot

79 Views Asked by At

I create dynamic query count query and pass star symbol inside the count function but Getting error at count(*) show me unexcepted error . I create query using entitymanager here is my query details

 @Autowired
    fun JobCompletionNotificationListener(em: EntityManager) {
        entityManager = entityManager
    }


override fun afterJob(jobExecution: JobExecution) {
        if (jobExecution.status === BatchStatus.COMPLETED){
            log.info("!!! JOB FINISHED! Time to verify the results")
            val teamDate : Map<String,Team> = HashMap()
            entityManager!!.createQuery("SELECT m.team1 , COUNT(*) FROM Match m GROUP BY m.team1",
            Array<Any>::class.java)
)
        }
    }

if this is the bad idea to create dynamic query how can I create dynamic count query I use Hyper SQL and spring batch

0

There are 0 best solutions below