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
Next revision
Previous revision
documentation:manual [2019/02/20 14:46]
darri [Introduction]
documentation:manual [2019/04/24 14:27] (current)
darri
Line 5: Line 5:
 ==== Common classes ==== ==== Common classes ====
  
-Two common classes used throughout the framework are the [[http://docs.jminor.org/​api/​org/​jminor/​common/​Event.html|Event]] and [[http://docs.jminor.org/​api/​org/​jminor/​common/​State.html|State]] classes and their respective observers [[http://docs.jminor.org/​api/​org/​jminor/​common/​EventObserver.html|EventObserver]] and [[http://docs.jminor.org/​api/​org/​jminor/​common/​StateObserver.html|StateObserver]] and listeners [[http://docs.jminor.org/​api/​org/​jminor/​common/​EventListener.html|EventListener]] and [[http://docs.jminor.org/​api/​org/​jminor/​common/​EventInfoListener.html|EventInfoListener]].+Two common classes used throughout the framework are the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​Event.html|Event]] and [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​State.html|State]] classes and their respective observers [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​EventObserver.html|EventObserver]] and [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​StateObserver.html|StateObserver]] and listeners [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​EventListener.html|EventListener]] and [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​EventInfoListener.html|EventInfoListener]].
  
 === Event === === Event ===
  
-The [[http://docs.jminor.org/​api/​org/​jminor/​common/​Event.html|Event]] class is a simple event implementation used throughout the framework to signal object state changes or to indicate that an action is about to start or has ended. Classes typically publish their events via public **addListener** methods. Events are triggered by calling the **fire()** method, with or without an **eventInfo** parameter.+The [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​Event.html|Event]] class is a simple event implementation used throughout the framework to signal object state changes or to indicate that an action is about to start or has ended. Classes typically publish their events via public **addListener** methods. Events are triggered by calling the **fire()** method, with or without an **eventInfo** parameter.
  
-Events are instantiated via the [[http://docs.jminor.org/​api/​org/​jminor/​common/​Events.html|Events]] factory class.+Events are instantiated via the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​Events.html|Events]] factory class.
  
-To listen to Events you use the [[http://docs.jminor.org/​api/​org/​jminor/​common/​EventListener.html|EventListener]] or [[http://docs.jminor.org/​api/​org/​jminor/​common/​EventDataListener.html|EventDataListener]] interfaces.+To listen to Events you use the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​EventListener.html|EventListener]] or [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​EventDataListener.html|EventDataListener]] interfaces.
  
 <code java> <code java>
Line 31: Line 31:
 === State === === State ===
  
-The [[http://docs.jminor.org/​api/​org/​jminor/​common/​State.html|State]] class encapsulates a boolean state (active/​inactive) and provides a [[http://docs.jminor.org/​api/​org/​jminor/​common/​StateObserver.html|StateObserver]]:​+The [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​State.html|State]] class encapsulates a boolean state (active/​inactive) and provides a [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​StateObserver.html|StateObserver]]:​
  
-States are instantiated via the [[http://docs.jminor.org/​api/​org/​jminor/​common/​States.html|States]] factory class.+States are instantiated via the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​States.html|States]] factory class.
  
 <code java> <code java>
Line 47: Line 47:
 </​code>​ </​code>​
  
-Any **Action** object can be linked to a **State** object via the **UiUtil.linkToEnabledState** method, ​whereas ​the action'​s **enabled** status is synchronized with the state.+Any **Action** object can be linked to a **State** object via the **UiUtil.linkToEnabledState** method, ​where the action'​s **enabled** status is synchronized with the state.
  
  
Line 70: Line 70:
 ==== Introduction ==== ==== Introduction ====
  
-The domain model is based around two interfaces, [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Entity.html|org.jminor.framework.domain.Entity]],​ which represents a row in a table, and [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.html|org.jminor.framework.domain.Property]],​ which represents columns. The [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Entities.html|org.jminor.framework.domain.Entities]] class serves ​both as a factory ​for Entity objects as well as a central repository for storing ​the domain model definition.+The domain model is based around two interfaces, [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Entity.html|org.jminor.framework.domain.Entity]],​ which represents a row in a table, and [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.html|org.jminor.framework.domain.Property]],​ which represents columns. The 
 +[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Domain.html|org.jminor.framework.domain.Domain]] class serves as a container ​for the domain model definition ​and as a factory for Entity and Entity.Key objects.
  
 ==== Entity ==== ==== Entity ====
Line 83: 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 96: Line 97:
  
 ==== Property ==== ==== Property ====
-Each column in a table is defined by the [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.html|Property]] class or one of its subclasses. The [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Properties.html|Properties]] class provides factory methods for constructing Property objects.+Each column in a table is defined by the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.html|Property]] class or one of its subclasses. The [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Properties.html|Properties]] class provides factory methods for constructing Property objects.
 The following properties can be set by using chained method calls: The following properties can be set by using chained method calls:
 //hidden, updatable, readOnly, nullable, defaultValue,​ maxLength, preferredWidth,​ description,​ mnemonic, columnHasDefaultValue,​ format// //hidden, updatable, readOnly, nullable, defaultValue,​ maxLength, preferredWidth,​ description,​ mnemonic, columnHasDefaultValue,​ format//
Line 110: Line 111:
   * Double (java.sql.Types.DOUBLE)   * Double (java.sql.Types.DOUBLE)
   * Long (java.sql.Types.BIGINT)   * Long (java.sql.Types.BIGINT)
-  * Timestamp ​(java.sql.Types.TIMESTAMP) +  * LocalDateTime ​(java.sql.Types.TIMESTAMP) 
-  * Date (java.sql.Types.DATE) +  * LocalDate ​(java.sql.Types.DATE) 
-  * Time (java.sql.Types.TIME)+  * LocalTime ​(java.sql.Types.TIME)
   * String (java.sql.Types.VARCHAR)   * String (java.sql.Types.VARCHAR)
   * Boolean (java.sql.Types.BOOLEAN)   * Boolean (java.sql.Types.BOOLEAN)
   * Character (java.sql.Types.CHAR)   * Character (java.sql.Types.CHAR)
   * Blob (java.sql.Types.BLOB)   * Blob (java.sql.Types.BLOB)
-  * Entity (java.sql.Types.REF) 
  
 === Property Id constants === === Property Id constants ===
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 163: Line 163:
  
 ===Property=== ===Property===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.html|Property]] and its subclasses is used to represent entity properties, these can be transient or based on table columns.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.html|Property]] and its subclasses is used to represent entity properties, these can be transient or based on table columns.
  
 <code java> <code java>
Line 170: Line 170:
  
 ===ColumnProperty=== ===ColumnProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.ColumnProperty.html|ColumnProperty]] is used to represent properties that are based on table columns.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.ColumnProperty.html|ColumnProperty]] is used to represent properties that are based on table columns.
  
 <code java> <code java>
Line 189: Line 189:
 </​code>​ </​code>​
 ===ForeignKeyProperty=== ===ForeignKeyProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.ForeignKeyProperty.html|ForeignKeyProperty]] is a wrapper property used to indicate a foreign key relation. These foreign keys refer to the primary key of the referenced entity and must be constructed accordingly in case of non-trivial primary keys.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.ForeignKeyProperty.html|ForeignKeyProperty]] is a wrapper property used to indicate a foreign key relation. These foreign keys refer to the primary key of the referenced entity and must be constructed accordingly in case of non-trivial primary keys.
 <code java> <code java>
 //referring to an entity with a single column primary key //referring to an entity with a single column primary key
Line 225: Line 225:
 Properties.booleanProperty(CUSTOMER_IS_ACTIVE,​ Types.INTEGER,​ "Is active",​ 1, 0) Properties.booleanProperty(CUSTOMER_IS_ACTIVE,​ Types.INTEGER,​ "Is active",​ 1, 0)
 </​code>​ </​code>​
-If the configuration parameter [[http://docs.jminor.org/​api/​org/​jminor/​common/​db/​Database.html#​DATABASE_TYPE|Database.DATABASE_TYPE]] has been set prior to calling **Properties.booleanProperty** and you skip specifying the true/false values, then the database implementation will supply the values typically used by the underlying DBMS, such as 1=true and 0=false for Oracle.+If the configuration parameter [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​db/​Database.html#​DATABASE_TYPE|Database.DATABASE_TYPE]] has been set prior to calling **Properties.booleanProperty** and you skip specifying the true/false values, then the database implementation will supply the values typically used by the underlying DBMS, such as 1=true and 0=false for Oracle.
  
 <code java> <code java>
Line 247: Line 247:
 </​code>​ </​code>​
 ===DenormalizedProperty=== ===DenormalizedProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.DenormalizedProperty.html|DenormalizedProperty]] is used for columns that should automatically get their value from a column in a referenced table. This property automatically gets the value from the column in the referenced table when the corresponding reference property value is set.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.DenormalizedProperty.html|DenormalizedProperty]] is used for columns that should automatically get their value from a column in a referenced table. This property automatically gets the value from the column in the referenced table when the corresponding reference property value is set.
 <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 270: Line 271:
 </​code>​ </​code>​
 ===SubqueryProperty=== ===SubqueryProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.SubqueryProperty.html|SubqueryProperty]] is used to represent properties which get their value from a subquery returning a single value. Note that in the example below //​referenceId//​ must be available when the query is run, that is, the entity must include that column as a property.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.SubqueryProperty.html|SubqueryProperty]] is used to represent properties which get their value from a subquery returning a single value. Note that in the example below //​referenceId//​ must be available when the query is run, that is, the entity must include that column as a property.
 <code java> <code java>
 Properties.subqueryProperty(SUBQUERY_PROPERTY_ID,​ Types.VARCHAR,​ "​Caption",​ Properties.subqueryProperty(SUBQUERY_PROPERTY_ID,​ Types.VARCHAR,​ "​Caption",​
Line 276: Line 277:
 </​code>​ </​code>​
 ===TransientProperty=== ===TransientProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.TransientProperty.html|TransientProperty]] is used to represent a property which has no underlying column, these properties all have a default value of null and can set and retrieved just like normal properties.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.TransientProperty.html|TransientProperty]] is used to represent a property which has no underlying column, these properties all have a default value of null and can set and retrieved just like normal properties.
  
 ===DerivedProperty=== ===DerivedProperty===
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.DerivedProperty.html|DerivedProperty]] is used to represent a transient property which value is derived from one or more linked property values. The value of a derived property is provided via a [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Property.DerivedProperty.Provider.html|DerivedProperty.Provider]] implementation as shown below.+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.DerivedProperty.html|DerivedProperty]] is used to represent a transient property which value is derived from one or more linked property values. The value of a derived property is provided via a [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Property.DerivedProperty.Provider.html|DerivedProperty.Provider]] implementation as shown below.
 <code java> <code java>
 Properties.derivedProperty(PROPERTY_ID,​ Types.INTEGER,​ "​Derived value",​ Properties.derivedProperty(PROPERTY_ID,​ Types.INTEGER,​ "​Derived value",​
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 [[http://docs.jminor.org/​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 [[http://docs.jminor.org/​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.
  
-[[http://docs.jminor.org/​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 {
Line 358: Line 359:
 </​code>​ </​code>​
  
-[[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​Entity.BackgroundColorProvider.html|Entity.BackgroundColorProvider]]+[[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​Entity.BackgroundColorProvider.html|Entity.BackgroundColorProvider]]
  
 Provides the background color for entity property cells when displayed in a table. Provides the background color for entity property cells when displayed in a table.
Line 453: Line 454:
 ==== Introduction ==== ==== Introduction ====
  
-To unit test the CRUD operations on the domain model extend [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html|EntityTestUnit]].+To unit test the CRUD operations on the domain model extend [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html|EntityTestUnit]].
  
 The unit tests are run within a single transaction which is rolled back after the test finishes, so these tests are pretty much guaranteed to leave no junk data behind. The unit tests are run within a single transaction which is rolled back after the test finishes, so these tests are pretty much guaranteed to leave no junk data behind.
Line 460: Line 461:
  
 The following methods all have default implementations which are based on randomly created property values, based on the constraints set in the domain model, override if the default ones are not working. The following methods all have default implementations which are based on randomly created property values, based on the constraints set in the domain model, override if the default ones are not working.
-  * [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​initializeReferenceEntity-java.lang.String-|initializeReferenceEntity]] should initialize return an instance of the given entity type to use for a foreign key reference required for inserting the entity being tested. +  * [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​initializeReferenceEntity-java.lang.String-|initializeReferenceEntity]] should initialize return an instance of the given entity type to use for a foreign key reference required for inserting the entity being tested. 
-  * [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​initializeTestEntity-java.lang.String-|initializeTestEntity]] should return a entity to use as basis for the unit test, that is, the entity that should be inserted, selected, updated and finally deleted. +  * [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​initializeTestEntity-java.lang.String-|initializeTestEntity]] should return a entity to use as basis for the unit test, that is, the entity that should be inserted, selected, updated and finally deleted. 
-  * [[http://docs.jminor.org/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​modifyEntity-org.jminor.framework.domain.Entity-|modifyEntity]] should simply leave the entity in a modified state so that it can be used for update test, since the db layer throws an exception if an unmodified entity is updated. If **modifyEntity** returns an unmodified entity, the update test is skipped.+  * [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​domain/​testing/​EntityTestUnit.html#​modifyEntity-org.jminor.framework.domain.Entity-|modifyEntity]] should simply leave the entity in a modified state so that it can be used for update test, since the db layer throws an exception if an unmodified entity is updated. If **modifyEntity** returns an unmodified entity, the update test is skipped.
  
 To run the full CRUD test for a domain entity you need to call the //​testEntity(String entityID)// method with the ID of the given entity as parameter. You can either create a single //​testDomain()//​ method and call the //​testEntity//​ method in turn for each entityID or create a single //​testEntityName//​ for each domain entity, as we do in the example below. To run the full CRUD test for a domain entity you need to call the //​testEntity(String entityID)// method with the ID of the given entity as parameter. You can either create a single //​testDomain()//​ method and call the //​testEntity//​ method in turn for each entityID or create a single //​testEntityName//​ for each domain entity, as we do in the example below.
Line 553: Line 554:
 ==== Introduction ==== ==== Introduction ====
  
-The [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityEditModel.html|EntityEditModel]] interface defines the CRUD business logic used by the [[http://docs.jminor.org/​api/​org/​jminor/​swing/​framework/​ui/​EntityEditPanel.html|EntityEditPanel]] class when entities are being edited, and must be defined for each entity requiring a CRUD user interface. The EntityEditModel works with a single entity instance, called the active entity, which can be set via the [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityEditModel.html#​setEntity-org.jminor.framework.domain.Entity-|setEntity(Entity entity)]] method and retrieved via [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityEditModel.html#​getEntityCopy--|getEntityCopy()]]. The EntityEditModel interface exposes a number of methods for manipulating as well as querying the property values of the active entity, via the [[http://docs.jminor.org/​api/​org/​jminor/​common/​model/​valuemap/​ValueMapEditModel.html|ValueMapEditModel]] interface which it extends<​code java>+The [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityEditModel.html|EntityEditModel]] interface defines the CRUD business logic used by the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​framework/​ui/​EntityEditPanel.html|EntityEditPanel]] class when entities are being edited, and must be defined for each entity requiring a CRUD user interface. The EntityEditModel works with a single entity instance, called the active entity, which can be set via the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityEditModel.html#​setEntity-org.jminor.framework.domain.Entity-|setEntity(Entity entity)]] method and retrieved via [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityEditModel.html#​getEntityCopy--|getEntityCopy()]]. The EntityEditModel interface exposes a number of methods for manipulating as well as querying the property values of the active entity, via the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​common/​model/​valuemap/​ValueMapEditModel.html|ValueMapEditModel]] interface which it extends<​code java>
 public class CustomerEditModel extends SwingEntityEditModel { public class CustomerEditModel extends SwingEntityEditModel {
   public CustomerEditModel(EntityConnectionProvider connectionProvider) {   public CustomerEditModel(EntityConnectionProvider connectionProvider) {
Line 610: Line 611:
 ==== Table model ==== ==== Table model ====
  
-Each [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityModel.html|EntityModel]] can contain a single [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityTableModel.html|EntityTableModel]] instance. This table model can be created automatically by the //​EntityModel//​ or supplied via a constructor argument in case of a specialized implementation.+Each [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityModel.html|EntityModel]] can contain a single [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityTableModel.html|EntityTableModel]] instance. This table model can be created automatically by the //​EntityModel//​ or supplied via a constructor argument in case of a specialized implementation.
  
 <code java> <code java>
Line 628: Line 629:
 ==== Edit model ==== ==== Edit model ====
  
-Each [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityModel.html|EntityModel]] contains a single [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityEditModel.html|EntityEditModel]] instance. This edit model can be created automatically by the //​EntityModel//​ or supplied via a constructor argument in case of a specialized implementation.+Each [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityModel.html|EntityModel]] contains a single [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityEditModel.html|EntityEditModel]] instance. This edit model can be created automatically by the //​EntityModel//​ or supplied via a constructor argument in case of a specialized implementation.
  
 <code java> <code java>
Line 689: Line 690:
 ==== Introduction ==== ==== Introduction ====
  
-The application load testing harness is used to see how your application,​ server and database handle multiple concurrent users. This is done by extending the abstract class [[http://docs.jminor.org/​api/​org/​jminor/​framework/​model/​EntityLoadTestModel.html|org.jminor.framework.model.EntityLoadTestModel]].+The application load testing harness is used to see how your application,​ server and database handle multiple concurrent users. This is done by extending the abstract class [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​framework/​model/​EntityLoadTestModel.html|org.jminor.framework.model.EntityLoadTestModel]].
  
 <code java> <code java>
Line 733: Line 734:
 ==== Introduction ==== ==== Introduction ====
  
-The [[http://docs.jminor.org/​api/​org/​jminor/​swing/​framework/​ui/​EntityPanel.html|EntityPanel]] is the base UI class for working with entity instances. It usually consists of an [[http://docs.jminor.org/​api/​org/​jminor/​swing/​framework/​ui/​EntityTablePanel.html|EntityTablePanel]],​ an [[http://docs.jminor.org/​api/​org/​jminor/​swing/​framework/​ui/​EntityEditPanel.html|EntityEditPanel]],​ which contains the controls (text fields, combo boxes and such) for editing an entity instance and a set of detail panels representing the entities having a master/​detail relationship with the underlying entity.+The [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​framework/​ui/​EntityPanel.html|EntityPanel]] is the base UI class for working with entity instances. It usually consists of an [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​framework/​ui/​EntityTablePanel.html|EntityTablePanel]],​ an [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​framework/​ui/​EntityEditPanel.html|EntityEditPanel]],​ which contains the controls (text fields, combo boxes and such) for editing an entity instance and a set of detail panels representing the entities having a master/​detail relationship with the underlying entity.
  
 ==== EntityEditPanel ==== ==== EntityEditPanel ====
Line 780: Line 781:
  
 ==== Custom actions ==== ==== Custom actions ====
-The action mechanism used throughout the JMinor framework is based on the [[http://docs.jminor.org/​api/​org/​jminor/​swing/​common/​ui/​control/​Control.html|Control]] class and its subclasses and the [[http://docs.jminor.org/​api/​org/​jminor/​swing/​common/​ui/​control/​ControlSet.html|ControlSet]] class which, as the name suggests, represents a set of controls. There are two static utility classes for creating and presenting controls, [[http://docs.jminor.org/​api/​org/​jminor/​swing/​common/​ui/​control/​Controls.html|Controls]] and [[http://docs.jminor.org/​api/​org/​jminor/​swing/​common/​ui/​control/​ControlProvider.html|ControlProvider]] respectively.+The action mechanism used throughout the JMinor framework is based on the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​common/​ui/​control/​Control.html|Control]] class and its subclasses and the [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​common/​ui/​control/​ControlSet.html|ControlSet]] class which, as the name suggests, represents a set of controls. There are two static utility classes for creating and presenting controls, [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​common/​ui/​control/​Controls.html|Controls]] and [[https://heima.hafro.is/​~darri/​jminor_wiki_data/​project/​docs/​api/​org/​jminor/​swing/​common/​ui/​control/​ControlProvider.html|ControlProvider]] respectively.
  
 === Controls === === Controls ===
documentation/manual.1550673989.txt.gz · Last modified: 2019/02/20 14:46 by darri