SchemaExport does not respect format from entered input.
Statements coming from <database-object><create> xml file are generated into database as a whole line. No way that they are perfectly formatted.
Statement entered:
Code:
<database-object>
<create>
<![CDATA[
create procedure
GRP_CONSTRAINTS(inout p_es_administrador char(1),
inout p_version bigint)
comment 'Restricciones de Grupo'
/**
* Constraints DEFAULT y CHECK
* Author: JMR
**/
begin
if(p_es_administrador is null) then
set p_es_administrador = 'F';
end if;
if(p_VERSION is null) then
set p_VERSION = 0;
end if;
if(p_ES_ADMINISTRADOR <> 'F'
and p_ES_ADMINISTRADOR <> 'T') then
signal sqlstate '45000'
set message_text = 'ES_ADMINISTRADOR ha de ser "F" o "T"';
end if;
if(p_VERSION < 0) then
signal sqlstate '45000'
set message_text = 'La VERSION ha de ser mayor o igual a 0';
end if;
end
]]>
</create>
<drop>
drop procedure if exists GRP_CONSTRAINTS
</drop>
<dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect" />
</database-object>
Exit from console looks like this:
Code:
create procedure GRP_CONSTRAINTS(inout p_es_administrador char(1), inout p_version bigint) comment 'Restricciones de Grupo' /** * Constraints DEFAULT y CHECK * Author: JMR **/ begin if(p_es_administrador is null) then set p_es_administrador = 'F'; end if; if(p_VERSION is null) then set p_VERSION = 0; end if; if(p_ES_ADMINISTRADOR <> 'F' and p_ES_ADMINISTRADOR <> 'T') then signal sqlstate '45000' set message_text = 'ES_ADMINISTRADOR ha de ser "F" o "T"'; end if; if(p_VERSION < 0) then signal sqlstate '45000' set message_text = 'La VERSION ha de ser mayor o igual a 0'; end if; end;
Any solution to this?
Best regards.