title: MySQL and import stored procedure on Hibernate start-up
body: <p>I want to update all my SPs when I run my java program (doesn't matter if it's not good practice).
  Since I'm using Hibernate 4.3.2.Final, I'm trying to avoid to write my own SQL executer for MySQL.
  So I'm trying to use hibernate.hbm2ddl.import_files in my hibernate.cfg.xml.
  It get the script, but it's not able to parse it. I've tryed with </p>
  
  <pre><code>    &lt;property name="hibernate.hbm2ddl.import_files"&gt;/Database/stored_procedures/load.sql&lt;/property&gt;
      &lt;property name="hibernate.hbm2ddl.import_files_sql_extractor"&gt;org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor&lt;/property&gt;
  </code></pre>
  
  <p>but I get</p>
  
  <pre><code>org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: '/Database/stored_procedures/load.sql'): DELIMITER $$ 
  Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$ 
  </code></pre>
  
  <p>the SP sql file runs fine on MySQL (tried many times) and it is something like:</p>
  
  <pre><code>DROP PROCEDURE IF EXISTS ebull.`load_friends`;
  
  DELIMITER $$ 
  
  CREATE PROCEDURE ebull.`load_friends`(
      IN transactionId BIGINT,
      IN chunk INT
  )
  BEGIN
      ...sql queries and stuff....
  
  END
  
  $$
  DELIMITER ;
  </code></pre>
  
  <p>I think it's something wrong with the delimiters, but I don't know how to avoid them since it's a stored procedure definition.
  I am starting thinking that this is not possible. Any idea?</p>