Populating the data model (inserting values into data model)

Source: Internet
Author: User

This chapter aims

We've learned how to create a new data model, and now we're going to insert some data into our new data model to test

There are 2 ways to insert data into the data model, one to insert data into the HMC, and one to use Hybris's Import-export data Framework, which is generally called Impex.

Enter Data via the HMC

Manually inserting some data through the HMC first

    1. Activate Hybris to Http://localhost:9001/hmc/hybris address
    2. Browse Stadium, click New and enter the data in the image below, click Cliclk to save a new stadium
    3. Add a second stadium, Name:allianz capacity:66000

Add some matches to the stadium created above

    1. First make sure that Cuppy, Cuppytrail and CUPPYTRAILHMC have been initialized.
    2. Assign some matches to the new stadium

Here we add some matchs examples to stadium to illustrate how the HMC handles these relationships types defined in Items.xml.

Impex by convention

I typically import data into the data model, most of which I would choose the Impex method-the "Impex by convention" definition is much more convenient than importing the bulk of the stadium data in the HMC.

    • Generic files are named Essentialdata*.impex and Projectdata*.impex, and files are saved under the <extension>resources/impex folder
    • If you use the Impex by configuration method, you must provide the Impex filename path in config/local.properties in advance. For details, refer to Impex Import for Essential and Project Data.
Create an Impex File

New file Cuppytrail/resources/impex/projectdatastadium.impex:

Insert_update stadium;code[unique=true];capacity; emirates;60361; villapark;42788 UPDATE Match;id[unique=true];group (Competition (code), code) [Unique=true];stadium (code); 1;wc2010:a ; emirates;2;wc2010:a; Emirates;3;wc2010:b; Emirates;4;wc2010:b; Villapark $START _userrightstype; UID; memberofgroups; Password; target;read;change;create;remove;change_permusergroup;cuppyadmins;;;;;;;;;;;; stadium;+;+;+;+;-$END _userrights
    1. This Impex contains a header row with a SQL table Command and columns, stating that we want to update the Table Stadium, I n Particular the columns code (whose values must be unique), capacity and matches whose IDs would be specified below. This was followed by several rows containing the data to import.
    2. We are specifying, stadiums and several matches to import
    3. The code attribute needs to be unique: unique=true.
    4. The Userrights section sets access rights for Cuppyadmins-usergroup on Stadium type.
    5. You can view the import file in Excel, but is aware that should not save the file in Excel as any special characters m Ay be corrupted

Invoke the Impex from within Hybris
    1. Open Platform/update Location
    2. Select only cuppytrail items
    3. This time the browser will display Creating project data for Cuppytrail ... Inform you that Impex has been executed
    4. If you have already completed trail ~ Integration in the HMC part of this study
      1. Open the HMC to see if the import was successful
    5. Supplemental points
      1. Select System-types in the HMC to search for "Stadium"
      2. In the results of the search, double-click Stadium
      3. Click the Edit button to perform a generic search, and in the results list, double-click the first
      4. A new browser window pops up and sees a new stadium

        

Or you can also import Impex in the HMC

    1. Landing HMC
    2. Open node System, Tools, Import
    3. Select the file location to import
    4. Click the Start button to perform the import

Populating the data model (inserting values into data model)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.