Module: Crudboy::Helper

Included in:
TemplateContext
Defined in:
lib/crudboy/helper.rb

Instance Method Summary collapse

Instance Method Details

#batch_insert_values_listObject



29
30
31
32
33
# File 'lib/crudboy/helper.rb', line 29

def batch_insert_values_list
  columns.map do |column|
    format('#{item.%s,jdbcType=%s}', column.lower_camel_name, column.jdbc_type)
  end.join(', ')
end

#column_names_listObject



17
18
19
20
21
# File 'lib/crudboy/helper.rb', line 17

def column_names_list
  columns.map do |column|
    format('`%s`', column.name)
  end.join(', ')
end

#insert_values_listObject



23
24
25
26
27
# File 'lib/crudboy/helper.rb', line 23

def insert_values_list
  columns.map do |column|
    column.mybatis_value_expression
  end.join(', ')
end

#lombokObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/crudboy/helper.rb', line 3

def lombok
  <<~EOF.chomp
  import lombok.AllArgsConstructor;
  import lombok.Builder;
  import lombok.Data;
  import lombok.NoArgsConstructor;

  @Data
  @Builder(toBuilder = true)
  @AllArgsConstructor
  @NoArgsConstructor
  EOF
end