JMinor Application Framework

As simple as possible but not simpler

User Tools

Site Tools


documentation:manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
documentation:manual [2019/04/24 14:22]
darri [Common classes]
documentation:manual [2019/04/24 14:27] (current)
darri
Line 84: Line 84:
  * The Store class defines the domain model for the Store application  * The Store class defines the domain model for the Store application
  */  */
-public class Store extends ​Entities ​{+public class Store extends ​Domain ​{
   //the full name of the table, will serve as the entityId for the Entity based on this table   //the full name of the table, will serve as the entityId for the Entity based on this table
   public static final String T_ADDRESS = "​store.address";​   public static final String T_ADDRESS = "​store.address";​
Line 127: Line 127:
  * The Store class defines the domain model for the Store application  * The Store class defines the domain model for the Store application
  */  */
-public class Store extends ​Entities ​{+public class Store extends ​Domain ​{
   //the full name of the table, will serve as the entityId for the Entity based on this table   //the full name of the table, will serve as the entityId for the Entity based on this table
   public static final String T_ADDRESS = "​store.address";​   public static final String T_ADDRESS = "​store.address";​
Line 250: Line 250:
 <code java> <code java>
 Properties.denormalizedProperty(CUSTOMER_CITY,​ CUSTOMER_ADDRESS_FK,​ Properties.denormalizedProperty(CUSTOMER_CITY,​ CUSTOMER_ADDRESS_FK,​
-        ​Entities.getProperty(T_ADDRESS,​ ADDRESS_CITY),​ "​City"​)+        getProperty(T_ADDRESS,​ ADDRESS_CITY),​ "​City"​)
 </​code>​ </​code>​
 //The property is not kept in sync if the denormalized property is updated in the referenced entity.// //The property is not kept in sync if the denormalized property is updated in the referenced entity.//
 <code java> <code java>
-Entity address = Entities.entityInstance(T_ADDRESS);​+Domain domain = getDomain();​ 
 +Entity address = domain.entity(T_ADDRESS);​
 address.put(ADDRESS_CITY,​ "​Syracuse"​);​ address.put(ADDRESS_CITY,​ "​Syracuse"​);​
  
-Entity customer = Entities.entityInstance(T_CUSTOMER);​+Entity customer = domain.entity(T_CUSTOMER);​
 customer.put(CUSTOMER_ADDRESS_FK,​ address); customer.put(CUSTOMER_ADDRESS_FK,​ address);
  
Line 294: Line 295:
 Example: [[documentation:​tutorials:​chinook#​domain_model|Chinook domain]] Example: [[documentation:​tutorials:​chinook#​domain_model|Chinook domain]]
  
-==== Entities ​====+==== Domain ​====
  
-The **Entities** class serves as a factory class for Entity objects as well as a central repository of entity meta-information,​ each entity type must be defined, by calling [[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Entities.html#​define-java.lang.String-org.jminor.framework.domain.Property...-|Entities.define]] for each entity. By default the framework uses the **entityId** as table name, unless the **tableName** parameter is specified.+The **Domain** class serves as a factory class for Entity objects as well as a central repository of entity meta-information ​(the domain model), each entity type must be defined, by calling [[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Domain.html#​define-java.lang.String-org.jminor.framework.domain.Property...-|Domain.define]] for each entity. By default the framework uses the **entityId** as table name, unless the **tableName** parameter is specified.
  
 <code java> <code java>
Line 329: Line 330:
 </​code>​ </​code>​
  
-==== Entities.StringProvider ====+==== Domain.StringProvider ====
  
-The [[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Entities.StringProvider.html|Entities.StringProvider]] class is for providing //​toString()//​ implementations for each Entity type. This value is f. ex. used when the entity instance is shown in a ComboBox or as a foreign key value in table views.+The [[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Domain.StringProvider.html|Domain.StringProvider]] class is for providing //​toString()//​ implementations for each Entity type. This value is f. ex. used when the entity instance is shown in a ComboBox or as a foreign key value in table views.
  
-See the Entities.StringProvider API doc for further information.+See the Domain.StringProvider API doc for further information.
  
 ==== Helper classes ==== ==== Helper classes ====
Line 339: Line 340:
 The following classes can come in handy when working with entities. The following classes can come in handy when working with entities.
  
-[[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Entities.Validator.html|Entities.Validator]]+[[https://​heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Domain.Validator.html|Domain.Validator]]
  
 A default **Entity.Validator** implementation which provides basic range and null validation, can be overridden to provide further validations. Note that this validator is called quite often so it should not perform expensive operations. Validation requiring database access f.ex. belongs in the application model or ui. A default **Entity.Validator** implementation which provides basic range and null validation, can be overridden to provide further validations. Note that this validator is called quite often so it should not perform expensive operations. Validation requiring database access f.ex. belongs in the application model or ui.
  
 <code java> <code java>
-define("​entityID",​ [...]).setValidator(new ​Entities.Validator() {+define("​entityID",​ [...]).setValidator(new ​Domain.Validator() {
       @Override       @Override
       public void validate(Entity entity, Property property) throws ValidationException {       public void validate(Entity entity, Property property) throws ValidationException {
documentation/manual.txt · Last modified: 2019/04/24 14:27 by darri