Sha256: a66da537eaacdce3ca877bc5e603c9175aa4473999674e4f9ac547825b731129

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 Bytes

Contents

package <%= models_package %>;

<% if options[:timestamps] %>
import java.util.Date;
<% end -%>

public class <%= class_name %> {

<% unless options[:singleton] -%>
  public int id;

<% end -%>
<% for attribute in attributes -%>
<% if attribute.type == :has_one -%>
  <%= attribute.name.classify %> <%= attribute.name %>;
<% elsif attribute.type == :has_many -%>
  public java.util.List<<%= attribute.name.classify %>> <%= attribute.name %>;
<% else -%>
  public <%= type_map[attribute.type] || attribute.type.to_s.classify %> <%= attribute.name.classify.underscore.sub(/^(.)/){ $1 } %>;
<% end -%>
<% end -%>
<% if options[:timestamps] %>
  public Date created_at;
  public Date updated_at;
<% end -%>
<% if options[:modified_by] %>
  public options[:modified_by].classify.underscore modified_by
<% end -%>
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
resty-generators-0.3.3 lib/generators/resty/templates/Model.java
resty-generators-0.3.2 lib/generators/resty/templates/Model.java
resty-generators-0.3.1 lib/generators/resty/templates/Model.java
resty-generators-0.3.0 lib/generators/resty/templates/Model.java