I have a stored function called getNextCode()
that requires a string parameter and returns a string. I wish to call this from my JPA enabled application. T
he following code fragment shows the use of the crateNativeQuery()
method to achieve this.
private String _getNextRollPackageCode() { String query = String.format( "SELECT getNextCode( '%s')", this.ROLL_PACKAGES_MODEL_NAME ); return this.ROLL_PACKAGE_CODE_PREFIX + "-" + (String) _entityManager.createNativeQuery(query) .getSingleResult(); }
No comments:
Post a Comment
I have had so many good people trying to promote various community oriented sites through here. Therefore all comments will first have to come through me... so I get a chance to learn about the interesting sites before you do ...