Support > Repository > Search control > Specify the reference linkage item as the search condition
ja | en

You can specify "reference linkage" item as search condition.

An example in which a "company" model is a parent and a "customer" model linked to it is a child

Figures 1 and 2 show the relationship between customers "Jasmine Soft" and "Jasmine Shoji" (Foreign key relationshipThe definition is done.

Figure 1 Two customers linked to the company "Jasmine Soft"
Figure 2 Two customers connected to the company "Jasmine Shoji"

Opens the search screen of the "customer" model (child).The company name is a reference linkage item, and it is not prepared (as a database definition) in the table of the customer model.You can combine with "company" model (which is parent) to perform a search.

3 Example of performing partial match search using linked items (1)
Fig. 4 Example of partial match search using linked items (2)

Definition of parent-child model relationship

In this example, we define the "company" model as the parent and the "customer" model as the child.

Figure 5 Company model and customer model
Figure 6 Relationship diagram centered on customer model

Company model

We will save the "company name" item in the database.(When you define an item, it will be saved in the database by default.)

Figure 7 Definition of company model

Customer model

"Company ID" is a foreign key.Prepare "company name" as reference linking item of company ID.

Figure 8 Customer model

Company ID

Specify the primary key of the company model as a foreign key.

Figure 9 Foreign key setting

company name

We refer to the company name (company model) with reference to the company ID (of the customer model) as a trigger.

Refer to Figure 10 Setting of interlocking

We do not save this item in the database.As a result, this company name field is no longer included in the table definition corresponding to the company model.

Figure 11 Do not save in database
You can also set to save to the database.In this case, even if the company name of the parent company model is changed, the data of the customer model that is a child is maintained as the old company name.

Search condition - Conditional expression

String type

The conditional expression is blank as standard.When using the reference linkage item as the search condition, it becomes an exact match search.

Fig. 12 Conditional expression not set yet

If you select "Partial match of character string", it becomes partial match search.(The operation shown in the above example is when this setting is made.)

Figure 13 Partial Match Search for Strings

Numeric, date type

By enabling range search, you can set search conditions by range.

Figure 14 Specifying range search

The reference destination item must be saved in the database

Referenced itemBe sure to "Save to database".(In the example above, "company name" of "company model" must be set to save in the database.)

When it can not be specified

The following specifications can not be performed.

  • The type of the reference destination item ("company" model in the above example) is "postal code".
  • In the reference source item ("customer" model in the above example)Switch list box/check box/radio button"Has been designated.
  • In the reference source item ("customer" model in the above example)Write-once type list box"Has been designated.

Constraint when using built-in database (HSQLDB)

When using the built-in database (HSQLDB), it does not work if the item name (English) in the model of the referenced item overlaps with the item name (English) in the model of the referring source item.

Example: If the primary key name of each model is the same (eg id), an error occurs in the built-in database.To use this function, change the primary key name for each model or use an external database.