| package ${{BASIC_PROJECT_NAME}}.entities { |
| |
| import org.eclipse.osbp.utils.blob.BlobMapping; |
| import ${{BASIC_PROJECT_NAME}}.datatypes.*; |
| |
| mapped superclass BaseID { |
| ${{ENTITY_PROPERTY_BASE_ID}} id; |
| } |
| |
| mapped superclass BaseUUID { |
| ${{ENTITY_PROPERTY_BASE_UUID}} id; |
| } |
| |
| entity CurrencyNamesStream extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Date importDate; |
| var boolean latest; |
| ref cascade CurrencyNames [*] currencyNames opposite currencynames_stream; |
| } |
| |
| cacheable entity CurrencyNames extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var String isoCode; |
| domainKey String name; |
| var String countries; |
| ref CurrencyNamesStream currencynames_stream opposite currencyNames; |
| ref cascade Currency [*] currencyRates opposite currency_name; |
| } |
| |
| entity CurrencyStream extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Date importDate; |
| var boolean latest; |
| ref cascade CurrencyDay [*] currencyDays opposite currencyday_stream; |
| } |
| |
| entity CurrencyDay extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Date ratingDate; |
| ref CurrencyStream currencyday_stream opposite currencyDays; |
| ref cascade Currency [*] currencyRates opposite currency_day; |
| } |
| |
| entity Currency extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var double conversion_ratio; |
| var Date currencyDate; |
| ref CurrencyDay currency_day opposite currencyRates; |
| ref CurrencyNames currency_name opposite currencyRates; |
| ref cascade Expense_fact [*] expenses opposite currency; |
| ref cascade Salary [*] salaries opposite currency; |
| } |
| |
| entity Days extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int day; |
| var String week_day; |
| } |
| |
| entity Product extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var String brand_name; |
| domainDescription String product_name |
| domainKey String sku; |
| var double srp; |
| var MassGRAMMetricCustomDecimal gross_weight; |
| var MassGRAMMetricCustomDecimal net_weight; |
| var boolean recyclable_package; |
| var boolean low_fat; |
| var int units_per_case; |
| var int cases_per_pallet; |
| var LengthCMMetricCustomDecimal shelf_width; |
| var LengthCMMetricCustomDecimal shelf_height; |
| var LengthMetricCustomDecimal shelf_depth; |
| ref Product_class product_class opposite products; |
| ref cascade Inventory_fact [*] inventories opposite product; |
| ref cascade Sales_fact [*] sales opposite product; |
| |
| index sku_index { |
| sku |
| } |
| } |
| |
| entity Product_Brown extends Product { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int diagonale; |
| } |
| |
| entity Product_White extends Product { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var double capacity; |
| } |
| |
| entity Product_class extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String product_subcategory; |
| var String product_category; |
| var String product_department; |
| var String product_family; |
| ref cascade Product [*] products opposite product_class properties(key = "Grid" value = ""); |
| } |
| |
| entity Position extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String position_title; |
| var String pay_type; |
| var double min_scale; |
| var double max_scale; |
| var String management_role; |
| ref cascade Employee [*] employees opposite position; |
| ref cascade Reserve_employee [*] reserve_employees opposite position; |
| } |
| |
| entity Region extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String sales_city; |
| var String sales_state_province; |
| var String sales_district; |
| var String sales_region; |
| var String sales_country; |
| var int sales_district_id; |
| ref cascade Store [*] stores opposite region; |
| ref cascade Store_ragged [*] stores_ragged opposite region; |
| ref cascade Customer [*] customers opposite region; |
| } |
| |
| entity Store_ragged extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var String store_type; |
| domainKey String store_name; |
| var int store_number; |
| var String store_street_address; |
| var String store_city; |
| var String store_state; |
| var String store_postal_code; |
| var String store_country; |
| var String store_manager; |
| var String store_phone; |
| var String store_fax; |
| var Date first_opened_date; |
| var Date last_remodel_date; |
| var double store_sqft; |
| var double grocery_sqft; |
| var double frozen_sqft; |
| var double meat_sqft; |
| var boolean coffee_bar; |
| var boolean video_store; |
| var boolean salad_bar; |
| var boolean prepared_food; |
| var boolean florist; |
| ref Region region opposite stores_ragged; |
| } |
| |
| entity Reserve_employee { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| id int employee_id; |
| domainKey String full_name; |
| var String first_name; |
| var String last_name; |
| var String position_title; |
| var Date birth_date; |
| var Date hire_date; |
| var Date end_date; |
| var double salary; |
| var int supervisor_id; |
| var String education_level; |
| var String marital_status; |
| var String gender; |
| ref Position position opposite reserve_employees; |
| ref Store store opposite reserve_employees; |
| ref Department department opposite reserve_employees; |
| } |
| |
| entity Time_by_day extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey Date the_date; |
| var String the_day; |
| var String the_month; |
| var String the_year; |
| var int day_of_month; |
| var int week_of_year; |
| var int month_of_year; |
| var String quarter; |
| var String fiscal_period; |
| ref cascade Inventory_fact [*] inventories opposite thattime; |
| ref cascade Expense_fact [*] expenses opposite thattime; |
| ref cascade Sales_fact [*] sales opposite thattime; |
| } |
| |
| entity Expense_fact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey Date exp_date; |
| var double amount; |
| ref Store store opposite expenses; |
| ref Account account opposite expenses; |
| ref Time_by_day thattime opposite expenses; |
| ref Category category opposite expenses; |
| ref Currency currency opposite expenses; |
| } |
| |
| entity Department extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String department_description; |
| ref cascade Employee [*] employees opposite department; |
| ref cascade Reserve_employee [*] reserve_employees opposite department; |
| ref cascade Salary [*] salaries opposite department; |
| } |
| |
| entity Employee_closure extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int supervisor_id; |
| var int distance; |
| ref cascade Employee [*] employees opposite employee_closure; |
| } |
| |
| entity Warehouse extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String warehouse_name; |
| var String wa_address1; |
| var String wa_address2; |
| var String wa_address3; |
| var String wa_address4; |
| var String warehouse_city; |
| var String warehouse_state_province; |
| var String warehouse_postal_code; |
| var String warehouse_country; |
| var String warehouse_owner_name; |
| var String warehouse_phone; |
| var String warehouse_fax; |
| ref Warehouse_class warehouse_class opposite warehouses; |
| ref Store store opposite warehouses; |
| ref cascade Inventory_fact [*] inventories opposite warehouse; |
| } |
| |
| entity Account extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Int account_parent; |
| domainKey String account_description; |
| var String account_type; |
| var String account_rollup; |
| var String custom_members; |
| ref cascade Expense_fact [*] expenses opposite account; |
| } |
| |
| entity Category { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| id String id; |
| var Int category_parent; |
| domainKey String category_description; |
| var String category_rollup; |
| ref cascade Expense_fact [*] expenses opposite category; |
| } |
| |
| entity Warehouse_class extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String description; |
| ref cascade Warehouse [*] warehouses opposite warehouse_class; |
| } |
| |
| entity Customer extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var long account_num; |
| var String lname; |
| var String fname; |
| var String mi; |
| var String address1; |
| var String address2; |
| var String address3; |
| var String address4; |
| var String city; |
| var String state_province; |
| var String postal_code; |
| var String country; |
| var String phone1; |
| var String phone2; |
| var Date birthdate; |
| var String marital_status; |
| var String yearly_income; |
| var String gender; |
| var int total_children; |
| var int num_children_at_home; |
| var String education; |
| var String date_accnt_opened; |
| var String member_card; |
| var String occupation; |
| var String houseowner; |
| var int num_cars_owned; |
| domainKey String fullname; |
| var String test; |
| ref Region region opposite customers; |
| ref cascade Sales_fact [*] sales opposite customer; |
| } |
| |
| entity Promotion extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int promotion_district_id; |
| domainKey String promotion_name; |
| var String media_type; |
| var double cost; |
| var Date start_date; |
| var Date end_date; |
| ref cascade Sales_fact [*] sales opposite promotion; |
| } |
| |
| entity Salary extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Date pay_date; |
| var double salary_paid; |
| var double overtime_paid; |
| var double vacation_accrued; |
| var double vacation_used; |
| ref Employee employee opposite salaries; |
| ref Department department opposite salaries; |
| ref Currency currency opposite salaries; |
| } |
| |
| entity Store extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var String store_type; |
| domainKey String store_name; |
| var int store_number; |
| var String store_street_address; |
| var String store_city; |
| var String store_state; |
| var String store_postal_code; |
| var String store_country; |
| var String store_manager; |
| var String store_phone; |
| var String store_fax; |
| var Date first_opened_date; |
| var Date last_remodel_date; |
| var int store_sqft; |
| var int grocery_sqft; |
| var double frozen_sqft; |
| var double meat_sqft; |
| var boolean coffee_bar; |
| var boolean video_store; |
| var boolean salad_bar; |
| var boolean prepared_food; |
| var boolean florist; |
| ref Region region opposite stores; |
| ref cascade Warehouse [*] warehouses opposite store; |
| ref cascade Employee [*] employees opposite store; |
| ref cascade Reserve_employee [*] reserve_employees opposite store; |
| ref cascade Inventory_fact [*] inventories opposite store; |
| ref cascade Expense_fact [*] expenses opposite store; |
| ref cascade Sales_fact [*] sales opposite store; |
| } |
| |
| entity Employee extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var BlobMapping profileimage; |
| domainKey String full_name; |
| var String first_name; |
| var String last_name; |
| var String position_title; |
| var BirthDate birth_date; |
| var Date hire_date; |
| var Date end_date; |
| var double salary; |
| var int supervisor_id; |
| var String education_level; |
| var String marital_status; |
| var String [ regex("M|F") ] gender properties(key = "functionImagePicker" value = "${{BASIC_PROJECT_NAME}}.functionlibrary.ComboBox.getImagePickerMap"); |
| var String management_role; |
| ref Position position opposite employees; |
| ref Store store opposite employees; |
| ref Department department opposite employees; |
| ref Employee_closure employee_closure opposite employees; |
| ref cascade Salary [*] salaries opposite employee; |
| } |
| |
| entity Sales_fact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var double store_sales; |
| var double store_cost; |
| var double unit_sales; |
| ref Product product opposite sales; |
| ref Time_by_day thattime opposite sales; |
| ref Customer customer opposite sales; |
| ref Promotion promotion opposite sales; |
| ref Store store opposite sales; |
| } |
| |
| entity Inventory_fact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int units_ordered; |
| var int units_shipped; |
| var double warehouse_sales; |
| var double warehouse_cost; |
| var int supply_time; |
| var double store_invoice; |
| ref Product product opposite inventories; |
| ref Time_by_day thattime opposite inventories; |
| ref Warehouse warehouse opposite inventories; |
| ref Store store opposite inventories; |
| } |
| |
| entity Supplier extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String company; |
| var String headquarter_city; |
| var String headquarter_zipcode; |
| var String gln; |
| var Date lastOrder; |
| var boolean locked; |
| var String phone; |
| var int priority; |
| var double yearlyTurnover; |
| var String headquarter_housenumber; |
| var String headquarter_streetname; |
| var Date firstContract; |
| var int rating; |
| } |
| |
| entity EDIOrders extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var Date importDate; |
| var boolean latest; |
| ref cascade EDIOrderHeader [*] orderHeaders opposite header_order; |
| } |
| |
| entity EDIOrderHeader extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int orderId; |
| var int statusCode; |
| var double netAmount; |
| var double totalAmount; |
| var double taxAmount; |
| var Date hdrDate; |
| ref cascade EDIOrderCustomer [*] ediOrderCustomer opposite customer_header; |
| ref cascade EDIOrderItem [*] ediOrderItem opposite item_header; |
| ref EDIOrders header_order opposite orderHeaders; |
| } |
| |
| entity EDIOrderCustomer extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| domainKey String userName; |
| var String firstName; |
| var String lastName; |
| var String country; |
| ref EDIOrderHeader customer_header opposite ediOrderCustomer; |
| } |
| |
| entity EDIOrderItem extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}"; |
| var int position; |
| var double quantity; |
| var long sku; |
| var String title; |
| var double price; |
| ref EDIOrderHeader item_header opposite ediOrderItem; |
| } |
| } |