Module: Rubernate::Relations::ClassMethods

Defined in:
lib/rubernate/relations.rb

Constant Summary collapse

@@supported_types =

Defines a ‘basic’ Supporte tipes

[:integer,:long,:short,:float,:double,:string,:char,:boolean]
@@supported_associations =
[:one_to_one,:one_to_many,:many_to_one,:many_to_many]

Instance Method Summary collapse

Instance Method Details

#add_field(name, type, *args) ⇒ Object



42
43
44
45
# File 'lib/rubernate/relations.rb', line 42

def add_field(name,type,*args)
  @fields ||= []        
  @fields << Hash[:name=>name,:type=>type,:args=>args]
end

#add_relation(name, clazz, type, params) ⇒ Object



55
56
57
58
# File 'lib/rubernate/relations.rb', line 55

def add_relation(name,clazz,type,params)
  @relations ||= []
  @relations << Hash[:name=>name,:class=>clazz,:type=>type,:params=>params]
end

#bind_class(clazz) ⇒ Object



30
31
32
# File 'lib/rubernate/relations.rb', line 30

def bind_class(clazz)
  @from_java_class = clazz
end

#fieldsObject



34
35
36
# File 'lib/rubernate/relations.rb', line 34

def fields
  @fields
end

#relationsObject



38
39
40
# File 'lib/rubernate/relations.rb', line 38

def relations
  @relations
end

#supported_associationsObject



64
65
66
# File 'lib/rubernate/relations.rb', line 64

def supported_associations
  @@supported_associations
end

#supported_typesObject



60
61
62
# File 'lib/rubernate/relations.rb', line 60

def supported_types
  @@supported_types
end

#table_nameObject



47
48
49
# File 'lib/rubernate/relations.rb', line 47

def table_name
  @table_name
end

#table_name=(table_name) ⇒ Object



51
52
53
# File 'lib/rubernate/relations.rb', line 51

def table_name=(table_name)
  @table_name=table_name
end