<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
  <persistence-unit name="<%= schema.name %>">
    <provider>org.hibernate.ejb.HibernatePersistence</provider><%
     schema.object_types.each do |object_type|
%>
    <class><%= object_type.java.fully_qualified_name %></class><% end %>
    <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
    <validation-mode>CALLBACK</validation-mode>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
    </properties>
  </persistence-unit>
</persistence>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
<% schema_set.schemas.each do |schema| %>
  <persistence-unit name="<%= schema.name %>">
    <provider>org.hibernate.ejb.HibernatePersistence</provider><%
     schema.object_types.each do |object_type|
%>
    <class><%= object_type.java.fully_qualified_name %></class><% end %>
    <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
    <validation-mode>CALLBACK</validation-mode>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
    </properties>
  </persistence-unit>
<% end %>
</persistence>
Refactor so that there is a single unit per "schema"
Refactor so that there is a single unit per "schema"
