<commit_before>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(data_module.imit.qualified_abstract_test_factory_name) %>;

@javax.annotation.Generated( "Domgen" )
@java.lang.SuppressWarnings( { "UnusedDeclaration", "JavaDoc" } )
public abstract class <%= data_module.imit.abstract_test_factory_name %>
{
  private final <%= data_module.repository.imit.qualified_test_factory_set_name %> _factorySet;
  private final com.google.inject.Injector _injector;

  protected <%= data_module.imit.abstract_test_factory_name %>( @javax.annotation.Nonnull final <%= data_module.repository.imit.qualified_test_factory_set_name %> factorySet, @javax.annotation.Nonnull final com.google.inject.Injector injector )
  {
    _factorySet = factorySet;
    _injector = injector;
  }

  protected final <%= data_module.repository.imit.qualified_test_factory_set_name %> getFactorySet()
  {
    return _factorySet;
  }

<% data_module.repository.data_modules.select{|dm|dm.imit? && dm.name != data_module.name}.each do |dm| -%>
  protected final <%= dm.imit.qualified_test_factory_name %> <%= Reality::Naming.camelize(dm.name) %>()
  {
    return getFactorySet().<%= Reality::Naming.camelize(dm.name) %>();
  }

<% end -%>
<% data_module.entities.select{|e|e.imit?}.each do |entity| -%>
<% if entity.concrete? -%>
  public final void delete<%= entity.name %>( @javax.annotation.Nonnull final <%= entity.imit.qualified_name %> $_ )
  {
    repository().deregisterEntity( <%= entity.imit.qualified_name %>.class, $_.get<%= entity.primary_key.name %>() );
  }

<% entity.imit.test_create_defaults.each do |defaults| -%>
  @javax.annotation.Nonnull
  public final <%= entity.imit.qualified_name %> create<%= entity.name %>( <%= entity.attributes.select{|a| a.imit? && a.imit.client_side? && !defaults.has_attribute?(a.name) }.collect{|a| "#{annotated_type(a, :imit, :default, :final => true)} #{Reality::Naming.camelize(a.name)}"}.join(', ') %>)
  {
    return create<%= entity.name %>( <%= entity.attributes.select{|a|a.imit? && a.imit.client_side?}.collect {|a| defaults.has_attribute?(a.name) ? defaults.value_for(a.name) : Reality::Naming.camelize(a.name) }.join(', ') %> );
  }

<% end -%>
  @javax.annotation.Nonnull
  public final <%= entity.imit.qualified_name %> create<%= entity.name %>( <%= entity.attributes.select{|a| a.imit? && a.imit.client_side?}.collect{|a| "#{annotated_type(a, :imit, :default, :final => true)} #{Reality::Naming.camelize(a.name)}"}.join(', ') %>)
  {
    final <%= entity.imit.qualified_name %> $_ = new <%= entity.imit.qualified_name %>( repository(), broker() );
<% entity.attributes.select{|a|a.imit? && a.imit.client_side?}.each do |a| -%>
<% if a.reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_entity.primary_key.name %>() );
<% elsif a.remote_reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_remote_entity.primary_key.name %>() );
<% elsif a.enumeration? -%>
    $_.set<%= a.name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.<%= a.enumeration.numeric_values? ? 'ordinal' : 'name' %>() );
<% else -%>
    $_.set<%= a.name %>( <%= Reality::Naming.camelize(a.name) %> );
<% end -%>
<% end -%>
    repository().registerEntity( <%= entity.imit.qualified_name %>.class, $_.get<%= entity.primary_key.name %>(), $_ );
    $_.link();
    return $_;
  }

<% end -%>
<% entity.attributes.select{|a|a.imit? && a.imit.client_side? && !a.immutable?}.each do |a| -%>
  public final void set<%= a.name %>( @javax.annotation.Nonnull final <%= entity.imit.qualified_name %> $_, <%= annotated_type(a, :imit, :default, :final => true) %> <%= Reality::Naming.camelize(a.name) %> )
  {
<% if a.reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_entity.primary_key.name %>() );
    $_.link();
<% elsif a.remote_reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_remote_entity.primary_key.name %>() );
    $_.link();
<% elsif a.enumeration? -%>
    $_.set<%= a.name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.<%= a.enumeration.numeric_values? ? 'ordinal' : 'name' %>() );
<% else -%>
    $_.set<%= a.name %>( <%= Reality::Naming.camelize(a.name) %> );
<% end -%>
  }

<% end -%>
<% end -%>
  @javax.annotation.Nonnull
  protected final org.realityforge.replicant.client.EntityRepository repository()
  {
    return s( org.realityforge.replicant.client.EntityRepository.class );
  }

  @javax.annotation.Nonnull
  protected final org.realityforge.replicant.client.EntityChangeBroker broker()
  {
    return s( org.realityforge.replicant.client.EntityChangeBroker.class );
  }
<commit_msg>Expose repository accessor for module in factories<commit_after>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(data_module.imit.qualified_abstract_test_factory_name) %>;

@javax.annotation.Generated( "Domgen" )
@java.lang.SuppressWarnings( { "UnusedDeclaration", "JavaDoc" } )
public abstract class <%= data_module.imit.abstract_test_factory_name %>
{
  private final <%= data_module.repository.imit.qualified_test_factory_set_name %> _factorySet;
  private final com.google.inject.Injector _injector;

  protected <%= data_module.imit.abstract_test_factory_name %>( @javax.annotation.Nonnull final <%= data_module.repository.imit.qualified_test_factory_set_name %> factorySet, @javax.annotation.Nonnull final com.google.inject.Injector injector )
  {
    _factorySet = factorySet;
    _injector = injector;
  }

  protected final <%= data_module.repository.imit.qualified_test_factory_set_name %> getFactorySet()
  {
    return _factorySet;
  }

<% data_module.repository.data_modules.select{|dm|dm.imit? && dm.name != data_module.name}.each do |dm| -%>
  protected final <%= dm.imit.qualified_test_factory_name %> <%= Reality::Naming.camelize(dm.name) %>()
  {
    return getFactorySet().<%= Reality::Naming.camelize(dm.name) %>();
  }

<% end -%>
<% data_module.entities.select{|e|e.imit?}.each do |entity| -%>
<% if entity.concrete? -%>
  public final void delete<%= entity.name %>( @javax.annotation.Nonnull final <%= entity.imit.qualified_name %> $_ )
  {
    repository().deregisterEntity( <%= entity.imit.qualified_name %>.class, $_.get<%= entity.primary_key.name %>() );
  }

<% entity.imit.test_create_defaults.each do |defaults| -%>
  @javax.annotation.Nonnull
  public final <%= entity.imit.qualified_name %> create<%= entity.name %>( <%= entity.attributes.select{|a| a.imit? && a.imit.client_side? && !defaults.has_attribute?(a.name) }.collect{|a| "#{annotated_type(a, :imit, :default, :final => true)} #{Reality::Naming.camelize(a.name)}"}.join(', ') %>)
  {
    return create<%= entity.name %>( <%= entity.attributes.select{|a|a.imit? && a.imit.client_side?}.collect {|a| defaults.has_attribute?(a.name) ? defaults.value_for(a.name) : Reality::Naming.camelize(a.name) }.join(', ') %> );
  }

<% end -%>
  @javax.annotation.Nonnull
  public final <%= entity.imit.qualified_name %> create<%= entity.name %>( <%= entity.attributes.select{|a| a.imit? && a.imit.client_side?}.collect{|a| "#{annotated_type(a, :imit, :default, :final => true)} #{Reality::Naming.camelize(a.name)}"}.join(', ') %>)
  {
    final <%= entity.imit.qualified_name %> $_ = new <%= entity.imit.qualified_name %>( repository(), broker() );
<% entity.attributes.select{|a|a.imit? && a.imit.client_side?}.each do |a| -%>
<% if a.reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_entity.primary_key.name %>() );
<% elsif a.remote_reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_remote_entity.primary_key.name %>() );
<% elsif a.enumeration? -%>
    $_.set<%= a.name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.<%= a.enumeration.numeric_values? ? 'ordinal' : 'name' %>() );
<% else -%>
    $_.set<%= a.name %>( <%= Reality::Naming.camelize(a.name) %> );
<% end -%>
<% end -%>
    repository().registerEntity( <%= entity.imit.qualified_name %>.class, $_.get<%= entity.primary_key.name %>(), $_ );
    $_.link();
    return $_;
  }

<% end -%>
<% entity.attributes.select{|a|a.imit? && a.imit.client_side? && !a.immutable?}.each do |a| -%>
  public final void set<%= a.name %>( @javax.annotation.Nonnull final <%= entity.imit.qualified_name %> $_, <%= annotated_type(a, :imit, :default, :final => true) %> <%= Reality::Naming.camelize(a.name) %> )
  {
<% if a.reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_entity.primary_key.name %>() );
    $_.link();
<% elsif a.remote_reference? -%>
    $_.set<%= a.referencing_link_name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.get<%= a.referenced_remote_entity.primary_key.name %>() );
    $_.link();
<% elsif a.enumeration? -%>
    $_.set<%= a.name %>( <%= a.nullable? ? "null == #{Reality::Naming.camelize(a.name)} ? null :" : '' %><%= Reality::Naming.camelize(a.name) %>.<%= a.enumeration.numeric_values? ? 'ordinal' : 'name' %>() );
<% else -%>
    $_.set<%= a.name %>( <%= Reality::Naming.camelize(a.name) %> );
<% end -%>
  }

<% end -%>
<% end -%>
<% data_module.daos.select{|dao| dao.imit? }.each do |dao| -%>

  @javax.annotation.Nonnull
  protected final <%= dao.imit.qualified_dao_service_name %> <%= Reality::Naming.camelize(dao.name) %>()
  {
    return s( <%= dao.imit.qualified_dao_service_name %>.class );
  }
<%
  end
-%>

  @javax.annotation.Nonnull
  protected final org.realityforge.replicant.client.EntityRepository repository()
  {
    return s( org.realityforge.replicant.client.EntityRepository.class );
  }

  @javax.annotation.Nonnull
  protected final org.realityforge.replicant.client.EntityChangeBroker broker()
  {
    return s( org.realityforge.replicant.client.EntityChangeBroker.class );
  }

{'fraction_non_alphanumeric': 0.21976701183431951, 'fraction_numerical': 0.0, 'mean_word_length': 4.684182869153967, 'pattern_counts': {'":': 0, '<': 166, '<?xml version=': 0, '>': 172, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6815441', 'n_tokens_mistral': 4196, 'n_tokens_neox': 3887, 'n_words': 539}