java - How do I use a stored procedure in h2 database while using junit? -


i have junit class file in turn calls dao class , creates stored procedure through entitymanager interface in dao class this:

@persistencecontext(unitname = "webapplication2pu") private entitymanager entitymanager; // entitmanager.createnamedstoredprocedurequery("next_prime") in method 

the next_prime procedure finds next prime provided number. procedure specified in entity bean class.

as have read h2 database not support stored procedure , instead have create java class, providing sql file database in junit class in runscript as: jdbc:h2:~/test;init=runscript mysql.sql

this sql file contains stored procedure as:

create alias next_prime $$ string nextprime(string value) {     return new biginteger(value).nextprobableprime().tostring(); } $$; 

i want override procedure specified in dao class use 1 providing in sql file.

how achieve this? or doing wrong, please suggest.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -