Module: CaRuby::Propertied
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
-
#autogenerated_attributes ⇒ <Symbol>
The auto-generated attributes.
-
#autogenerated_dependent_attributes ⇒ <Symbol>
The dependent attributes.
-
#autogenerated_logical_dependent_attributes ⇒ <Symbol>
The autogenerated logical dependent attributes.
-
#autogenerated_nondomain_attributes ⇒ <Symbol>
The auto-generated non-domain attributes.
-
#cascaded_attributes ⇒ <Symbol>
The create/update cascaded domain attributes.
-
#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.
-
#creatable_attributes ⇒ <Symbol>
The attributes which are CaRuby::PropertyCharacteristics#creatable?.
-
#creatable_domain_attributes ⇒ <Symbol>
The domain #creatable_attributes.
-
#fetched_attributes ⇒ <Symbol>
The attributes which are populated from the database.
- #fetched_dependent_attributes ⇒ Object
-
#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.
-
#loadable_attributes ⇒ <Symbol>
The Java attribute non-abstract #unfetched_attributes.
-
#logical_dependent_attributes ⇒ <Symbol>
The logical dependent attributes.
-
#proxied_savable_template_attributes ⇒ <Symbol>
The #cascaded_attributes which are saved with a proxy using the dependent saver_proxy method.
-
#savable_template_attributes ⇒ <Symbol>
The #domain_attributes to CaRuby::PropertyCharacteristics#include_in_save_template?.
-
#saved_attributes_to_fetch ⇒ <Symbol>
The CaRuby::PropertyCharacteristics#fetch_saved? attributes.
-
#saved_dependent_attributes ⇒ <Symbol>
The saved dependent attributes.
-
#saved_independent_attributes ⇒ <Symbol>
The saved Property#independent? attributes.
-
#saved_nondomain_attributes ⇒ <Symbol>
The non-domain CaRuby::PropertyCharacteristics#saved? attributes.
-
#searchable_attributes ⇒ <Symbol>
The domain attributes which can serve as a query parameter.
-
#sync_domain_attributes ⇒ <Symbol>
The domain CaRuby::PropertyCharacteristics#sync? attributes.
-
#unfetched_attributes ⇒ <Symbol>
(also: #toxic_attributes)
The #domain_attributes which are not #fetched_domain_attributes.
-
#unproxied_savable_template_attributes ⇒ <Symbol>
The #cascaded_attributes which do not have a #CaRuby::PropertyCharacteristics#proxied_save?.
-
#updatable_attributes ⇒ <Symbol>
The attributes which are CaRuby::PropertyCharacteristics#updatable?.
-
#updatable_domain_attributes ⇒ <Symbol>
The domain #updatable_attributes.
-
#volatile_nondomain_attributes ⇒ <Symbol>
The CaRuby::PropertyCharacteristics#volatile? #nondomain_attributes.
Instance Method Details
#autogenerated_attributes ⇒ <Symbol>
Returns the auto-generated attributes.
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.
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.
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.
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.
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.
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?.
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.
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.
149 150 151 |
# File 'lib/caruby/metadata/propertied.rb', line 149 def fetched_attributes @fch_flt ||= attribute_filter { |prop| prop.fetched? } end |
#fetched_dependent_attributes ⇒ Object
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
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.
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.
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.
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 the #domain_attributes to CaRuby::PropertyCharacteristics#include_in_save_template?.
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 the CaRuby::PropertyCharacteristics#fetch_saved? attributes.
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.
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.
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.
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.
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.
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.
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 the #cascaded_attributes which do not have a #CaRuby::PropertyCharacteristics#proxied_save?.
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?.
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.
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.
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 |