Module: CaRuby::Propertied

Includes:
Jinx::Propertied
Included in:
Metadata
Defined in:
lib/caruby/metadata/propertied.rb

Overview

Augments a caRuby application domain class with PropertyCharacteristics persistence meta-data.

A Jinx-enabled caRuby application domain module enables CaRuby persistence by adding the following method definition:

def self.(klass)
  super
  klass.extend(CaRuby::Propertied)
end

Instance Method Summary collapse

Instance Method Details

#autogenerated_attributes<Symbol>

Returns the auto-generated attributes.

Returns:

  • (<Symbol>)

    the auto-generated attributes

See Also:



42
43
44
# File 'lib/caruby/metadata/propertied.rb', line 42

def autogenerated_attributes
  @ag_flt ||= attribute_filter { |prop| prop.autogenerated? }
end

#autogenerated_dependent_attributes<Symbol>

Returns the dependent attributes.

Returns:

  • (<Symbol>)

    the dependent attributes



18
19
20
# File 'lib/caruby/metadata/propertied.rb', line 18

def autogenerated_dependent_attributes
  @ag_dep_flt ||= dependent_attributes.compose { |prop| prop.autogenerated? }
end

#autogenerated_logical_dependent_attributes<Symbol>

Returns the autogenerated logical dependent attributes.

Returns:

  • (<Symbol>)

    the autogenerated logical dependent attributes

See Also:



25
26
27
# File 'lib/caruby/metadata/propertied.rb', line 25

def autogenerated_logical_dependent_attributes
  @ag_log_dep_flt ||= dependent_attributes.compose { |prop| prop.autogenerated? and prop.logical? }
end

#autogenerated_nondomain_attributes<Symbol>

Returns the auto-generated non-domain attributes.

Returns:

  • (<Symbol>)

    the auto-generated non-domain attributes

See Also:



49
50
51
# File 'lib/caruby/metadata/propertied.rb', line 49

def autogenerated_nondomain_attributes
  @ag_nd_flt ||= attribute_filter { |prop| prop.autogenerated? and prop.nondomain? }
end

#cascaded_attributes<Symbol>

Returns the create/update cascaded domain attributes.

Returns:

  • (<Symbol>)

    the create/update cascaded domain attributes

See Also:



66
67
68
# File 'lib/caruby/metadata/propertied.rb', line 66

def cascaded_attributes
  @cscd_flt ||= domain_attributes.compose { |prop| prop.cascaded? }
end

#copyable_saved_attributes<Symbol>

Returns the physical or auto-generated logical dependent attributes that can be copied from a save result to the given save argument object.

Returns:

  • (<Symbol>)

    the attributes that can be copied from a save result to a save argument object

See Also:



93
94
95
# File 'lib/caruby/metadata/propertied.rb', line 93

def copyable_saved_attributes
  @cp_sv_flt ||= dependent_attributes.compose { |prop| prop.autogenerated? or not prop.logical? }
end

#creatable_attributes<Symbol>

Returns the attributes which are CaRuby::PropertyCharacteristics#creatable?.

Returns:



98
99
100
# File 'lib/caruby/metadata/propertied.rb', line 98

def creatable_attributes
  @cr_flt ||= attribute_filter { |prop| prop.creatable? }
end

#creatable_domain_attributes<Symbol>

Returns the domain #creatable_attributes.

Returns:



138
139
140
# File 'lib/caruby/metadata/propertied.rb', line 138

def creatable_domain_attributes
  @cr_dom_flt ||= domain_attributes.compose { |prop| prop.creatable? }
end

#fetched_attributes<Symbol>

Returns the attributes which are populated from the database.

Returns:

  • (<Symbol>)

    the attributes which are populated from the database

See Also:



149
150
151
# File 'lib/caruby/metadata/propertied.rb', line 149

def fetched_attributes
  @fch_flt ||= attribute_filter { |prop| prop.fetched? }
end

#fetched_dependent_attributesObject



107
108
109
# File 'lib/caruby/metadata/propertied.rb', line 107

def fetched_dependent_attributes
  @fch_dep_flt ||= (fetched_domain_attributes & dependent_attributes).to_a
end

#fetched_domain_attributes<Symbol>

Returns the domain attributes which are populated in a query on the given fetched instance of this metadata’s subject class. The domain attribute is fetched if it satisfies the following conditions:

  • the attribute is a dependent attribute or of abstract domain type

  • the attribute is not specified as unfetched in the configuration

Returns:



160
161
162
# File 'lib/caruby/metadata/propertied.rb', line 160

def fetched_domain_attributes
  @fch_dom_flt ||= domain_attributes.compose { |prop| prop.fetched? }
end

#loadable_attributes<Symbol>

Returns the Java attribute non-abstract #unfetched_attributes.

Returns:



176
177
178
179
180
181
# File 'lib/caruby/metadata/propertied.rb', line 176

def loadable_attributes
  # A change to this method body must be copied to CaTissue::Metadata; see rubydoc above.
  @ld_flt ||= unfetched_attributes.compose do |prop|
    prop.java_property? and not prop.type.abstract? and not prop.transient?
  end
end

#logical_dependent_attributes<Symbol>

Returns the logical dependent attributes.

Returns:

  • (<Symbol>)

    the logical dependent attributes

See Also:



36
37
38
# File 'lib/caruby/metadata/propertied.rb', line 36

def logical_dependent_attributes
  @log_dep_flt ||= dependent_attributes.compose { |prop| prop.logical? }
end

#proxied_savable_template_attributes<Symbol>

Returns the #cascaded_attributes which are saved with a proxy using the dependent saver_proxy method.

Returns:

  • (<Symbol>)

    the #cascaded_attributes which are saved with a proxy using the dependent saver_proxy method



72
73
74
# File 'lib/caruby/metadata/propertied.rb', line 72

def proxied_savable_template_attributes
  @px_cscd_flt ||= savable_template_attributes.compose { |prop| prop.proxied_save? }
end

#savable_template_attributes<Symbol>

Returns:



83
84
85
# File 'lib/caruby/metadata/propertied.rb', line 83

def savable_template_attributes
  @sv_tmpl_flt ||= domain_attributes.compose { |prop| prop.include_in_save_template? }
end

#saved_attributes_to_fetch<Symbol>

Returns:



30
31
32
# File 'lib/caruby/metadata/propertied.rb', line 30

def saved_attributes_to_fetch
  @sv_ftch_flt ||= domain_attributes.compose { |prop| prop.fetch_saved? }
end

#saved_dependent_attributes<Symbol>

Returns the saved dependent attributes.

Returns:

  • (<Symbol>)

    the saved dependent attributes



112
113
114
# File 'lib/caruby/metadata/propertied.rb', line 112

def saved_dependent_attributes
  @sv_dep_flt ||= attribute_filter { |prop| prop.dependent? and prop.saved? }
end

#saved_independent_attributes<Symbol>

Returns the saved Property#independent? attributes.

Returns:

  • (<Symbol>)

    the saved Property#independent? attributes

See Also:



118
119
120
# File 'lib/caruby/metadata/propertied.rb', line 118

def saved_independent_attributes
  @sv_ind_flt ||= attribute_filter { |prop| prop.independent? and prop.saved? }
end

#saved_nondomain_attributes<Symbol>

Returns the non-domain CaRuby::PropertyCharacteristics#saved? attributes.

Returns:



128
129
130
# File 'lib/caruby/metadata/propertied.rb', line 128

def saved_nondomain_attributes
  @sv_ndom_flt ||= nondomain_attributes.compose { |prop| prop.saved? }
end

#searchable_attributes<Symbol>

Returns the domain attributes which can serve as a query parameter.

Returns:

  • (<Symbol>)

    the domain attributes which can serve as a query parameter

See Also:



60
61
62
# File 'lib/caruby/metadata/propertied.rb', line 60

def searchable_attributes
  @srchbl_flt ||= attribute_filter { |prop| prop.searchable? }
end

#sync_domain_attributes<Symbol>

Returns the domain CaRuby::PropertyCharacteristics#sync? attributes.

Returns:



123
124
125
# File 'lib/caruby/metadata/propertied.rb', line 123

def sync_domain_attributes
  @sv_sync_dom_flt ||= domain_attributes.compose { |prop| prop.sync? }
end

#unfetched_attributes<Symbol> Also known as: toxic_attributes

Returns the #domain_attributes which are not #fetched_domain_attributes.

Returns:

  • (<Symbol>)

    the #domain_attributes which are not #fetched_domain_attributes



165
166
167
# File 'lib/caruby/metadata/propertied.rb', line 165

def unfetched_attributes
  @unftchd_flt ||= domain_attributes.compose { |prop| not prop.fetched? }
end

#unproxied_savable_template_attributes<Symbol>

Returns:



78
79
80
# File 'lib/caruby/metadata/propertied.rb', line 78

def unproxied_savable_template_attributes
  @unpx_sv_tmpl_flt ||= savable_template_attributes.compose { |prop| not prop.proxied_save? }
end

#updatable_attributes<Symbol>

Returns the attributes which are CaRuby::PropertyCharacteristics#updatable?.

Returns:



103
104
105
# File 'lib/caruby/metadata/propertied.rb', line 103

def updatable_attributes
  @upd_flt ||= attribute_filter { |prop| prop.updatable? }
end

#updatable_domain_attributes<Symbol>

Returns the domain #updatable_attributes.

Returns:



143
144
145
# File 'lib/caruby/metadata/propertied.rb', line 143

def updatable_domain_attributes
  @upd_dom_flt ||= domain_attributes.compose { |prop| prop.updatable? }
end

#volatile_nondomain_attributes<Symbol>

Returns the CaRuby::PropertyCharacteristics#volatile? #nondomain_attributes.

Returns:



54
55
56
# File 'lib/caruby/metadata/propertied.rb', line 54

def volatile_nondomain_attributes
  @unsvd_nd_flt ||= attribute_filter { |prop| prop.volatile? and prop.nondomain? }
end