class MiniProperty

Public Class Methods

new(row, sheet) click to toggle source
# File lib/sawa/MiniProperty.rb, line 2
def initialize(row, sheet)
  @row = row
  @sheet = sheet
  @idx_type = 1
  @idx_name = 2
  @idx_unique = 3
  @idx_nullable = 4
  @idx_jsonignore = 5
  @idx_title = 6
  @idx_mappedBy = 7
  @idx_refColumn = 8
  @idx_searchKey = 9
end

Public Instance Methods

has_mapped() click to toggle source
# File lib/sawa/MiniProperty.rb, line 65
def has_mapped
  @row[@idx_mappedBy] == "1:1" or @row[@idx_mappedBy] == "1:n" or @row[@idx_mappedBy] == "n:1"
end
is_column() click to toggle source
# File lib/sawa/MiniProperty.rb, line 61
def is_column
  @row[@idx_unique] != "-"
end
is_manytoone() click to toggle source
# File lib/sawa/MiniProperty.rb, line 77
def is_manytoone
  @row[@idx_mappedBy] == "n:1"
end
is_onetomany() click to toggle source
# File lib/sawa/MiniProperty.rb, line 73
def is_onetomany
  @row[@idx_mappedBy] == "1:n"
end
is_onetoone() click to toggle source
# File lib/sawa/MiniProperty.rb, line 81
def is_onetoone
  @row[@idx_mappedBy] == "1:1"
end
is_searchkey() click to toggle source
# File lib/sawa/MiniProperty.rb, line 85
def is_searchkey
  @row[@idx_searchKey] == "1"
end
is_string() click to toggle source
# File lib/sawa/MiniProperty.rb, line 28
def is_string
  @row[@idx_type] == "java.lang.String"
end
join_column() click to toggle source
# File lib/sawa/MiniProperty.rb, line 69
def join_column
  @row[@idx_refColumn]
end
jsonignore() click to toggle source
# File lib/sawa/MiniProperty.rb, line 53
def jsonignore
  @row[@idx_jsonignore] == "1"
end
name() click to toggle source
# File lib/sawa/MiniProperty.rb, line 20
def name
  @row[@idx_name]
end
nullable() click to toggle source
# File lib/sawa/MiniProperty.rb, line 49
def nullable
  @row[@idx_nullable] == "1"
end
resource_name() click to toggle source
# File lib/sawa/MiniProperty.rb, line 16
def resource_name
  @sheet.resource_path
end
title() click to toggle source
# File lib/sawa/MiniProperty.rb, line 57
def title
  @row[@idx_title]
end
type() click to toggle source
# File lib/sawa/MiniProperty.rb, line 24
def type
  @row[@idx_type]
end
type_js() click to toggle source
# File lib/sawa/MiniProperty.rb, line 32
def type_js
  if @row[@idx_type] == "java.lang.String"
    return "txt"
  end
  if @row[@idx_type] == "java.lang.Integer" or @row[@idx_type] == "java.lang.Short" or @row[@idx_type] == "java.lang.Long" or @row[@idx_type] == "java.lang.Float" or @row[@idx_type] == "java.lang.Double"
    return "num"
  end
  if @row[@idx_type].start_with?("java.util.List")
    return "list"
  end
  return "obj"
end
unique() click to toggle source
# File lib/sawa/MiniProperty.rb, line 45
def unique
  @row[@idx_unique] == "1"
end