| import javax.persistence.PrePersist |
| import ns org.eclipse.osbp.utils.blob.BlobMapping |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.BirthDate |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.BlobMapping |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.Date |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.DateTime |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.Int |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.LengthCMMetricCustomDecimal |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.LengthMetricCustomDecimal |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.MassGRAMMetricCustomDecimal |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.String |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.boolean |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.double |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.int |
| import ns ${{BASIC_PROJECT_NAME}}.model.datatypes.long |
| import org.eclipse.osbp.runtime.common.annotations.CreateAt |
| import org.eclipse.osbp.runtime.common.annotations.CreateBy |
| import org.eclipse.osbp.runtime.common.annotations.UpdateAt |
| import org.eclipse.osbp.runtime.common.annotations.UpdateBy |
| |
| |
| package ${{MODEL_PROJECT_PACKAGE_NAME}} { |
| |
| mappedSuperclass BaseID { |
| ${{ENTITY_PROPERTY_BASE_ID}} id |
| version int version |
| @CreateBy |
| var String createdBy |
| @CreateAt |
| var DateTime created |
| @UpdateBy |
| var String updatedBy |
| @UpdateAt |
| var DateTime updated |
| } |
| |
| mappedSuperclass BaseUUID { |
| ${{ENTITY_PROPERTY_BASE_UUID}} id |
| version int version |
| @CreateBy |
| var String createdBy |
| @CreateAt |
| var DateTime created |
| @UpdateBy |
| var String updatedBy |
| @UpdateAt |
| var DateTime updated |
| } |
| |
| entity CurrencyNamesStream extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date importDate |
| var boolean latest |
| ref cascadeMergePersist CurrencyNames [*] currencyNames opposite currencynamesStream |
| } |
| |
| cacheable entity CurrencyNames extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var String isoCode |
| domainKey String name |
| var String countries |
| ref CurrencyNamesStream currencynamesStream opposite currencyNames |
| ref cascadeMergePersist Currency [*] currencyRates opposite currencyName |
| } |
| |
| entity CurrencyStream extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date importDate |
| var boolean latest |
| ref cascadeMergePersist CurrencyDay [*] currencyDays opposite currencydayStream |
| } |
| |
| entity CurrencyDay extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date ratingDate |
| ref CurrencyStream currencydayStream opposite currencyDays |
| ref cascadeMergePersist Currency [*] currencyRates opposite currencyDay |
| } |
| |
| entity Currency extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var double conversionRatio |
| var Date currencyDate |
| ref CurrencyDay currencyDay opposite currencyRates |
| ref CurrencyNames currencyName opposite currencyRates |
| ref ExpenseFact [*] expenses opposite currency |
| ref Salary [*] salaries opposite currency |
| } |
| |
| entity Days extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var int day |
| var String weekDay |
| } |
| |
| entity Product extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var String brandName |
| domainDescription String productName |
| domainKey String sku |
| var double srp |
| var MassGRAMMetricCustomDecimal grossWeight |
| var MassGRAMMetricCustomDecimal netWeight |
| var boolean recyclablePackage |
| var boolean lowFat |
| var int unitsPerCase |
| var int casesPerPallet |
| var LengthCMMetricCustomDecimal shelfWidth |
| var LengthCMMetricCustomDecimal shelfHeight |
| var LengthMetricCustomDecimal shelfDepth |
| ref ProductClass productClass opposite products |
| ref InventoryFact [*] inventories opposite product |
| ref SalesFact [*] sales opposite product |
| |
| index skuIndex { |
| sku |
| } |
| } |
| |
| entity ProductBrown extends Product { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var int diagonale |
| } |
| |
| entity ProductWhite extends Product { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var double capacity |
| } |
| |
| entity ProductClass extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String productSubcategory |
| var String productCategory |
| var String productDepartment |
| var String productFamily |
| ref Product [*] products opposite productClass properties(key = "Grid" value = "") |
| } |
| |
| entity Position extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String positionTitle |
| var String payType |
| var double minScale |
| var double maxScale |
| var String managementRole |
| ref Employee [*] employees opposite position |
| ref ReserveEmployee [*] reserveEmployees opposite position |
| } |
| |
| entity Region extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String salesCity |
| var String salesStateProvince |
| var String salesDistrict |
| var String salesRegion |
| var String salesCountry |
| var int salesDistrictId |
| ref Store [*] stores opposite region |
| ref StoreRagged [*] storesRagged opposite region |
| ref Customer [*] customers opposite region |
| } |
| |
| entity StoreRagged extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var String storeType |
| domainKey String storeName |
| var int storeNumber |
| var String storeStreetAddress |
| var String storeCity |
| var String storeState |
| var String storePostalCode |
| var String storeCountry |
| var String storeManager |
| var String storePhone |
| var String storeFax |
| var Date firstOpenedDate |
| var Date lastRemodelDate |
| var double storeSqft |
| var double grocerySqft |
| var double frozenSqft |
| var double meatSqft |
| var boolean coffeeBar |
| var boolean videoStore |
| var boolean saladBar |
| var boolean preparedFood |
| var boolean florist |
| ref Region region opposite storesRagged |
| } |
| |
| entity ReserveEmployee { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| id int employeeId |
| domainKey String fullName |
| var String firstName |
| var String lastName |
| var String positionTitle |
| var Date birthDate |
| var Date hireDate |
| var Date endDate |
| var double salary |
| var int supervisorId |
| var String educationLevel |
| var String maritalStatus |
| var String gender |
| ref Position position opposite reserveEmployees |
| ref Store store opposite reserveEmployees |
| ref Department department opposite reserveEmployees |
| } |
| |
| entity TimeByDay extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date theDate |
| var String theDay |
| var String theMonth |
| var String theYear |
| var int dayOfMonth |
| var int weekOfYear |
| var int monthOfYear |
| var String quarter |
| var String fiscalPeriod |
| ref InventoryFact [*] inventories opposite thattime |
| ref ExpenseFact [*] expenses opposite thattime |
| ref SalesFact [*] sales opposite thattime |
| } |
| |
| entity ExpenseFact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date expDate |
| var double amount |
| ref Store store opposite expenses |
| ref Account account opposite expenses |
| ref TimeByDay thattime opposite expenses |
| ref Category category opposite expenses |
| ref Currency currency opposite expenses |
| } |
| |
| entity Department extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String departmentDescription |
| ref Employee [*] employees opposite department |
| ref ReserveEmployee [*] reserveEmployees opposite department |
| ref Salary [*] salaries opposite department |
| } |
| |
| entity EmployeeClosure extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var int supervisorId |
| var int distance |
| ref Employee [*] employees opposite employeeClosure |
| } |
| |
| entity Warehouse extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String warehouseName |
| var String waAddress1 |
| var String waAddress2 |
| var String waAddress3 |
| var String waAddress4 |
| var String warehouseCity |
| var String warehouseStateProvince |
| var String warehousePostalCode |
| var String warehouseCountry |
| var String warehouseOwnerName |
| var String warehousePhone |
| var String warehouseFax |
| ref WarehouseClass warehouseClass opposite warehouses |
| ref Store store opposite warehouses |
| ref InventoryFact [*] inventories opposite warehouse |
| } |
| |
| entity Account extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Int accountParent |
| domainKey String accountDescription |
| var String accountType |
| var String accountRollup |
| var String customMembers |
| ref ExpenseFact [*] expenses opposite account |
| } |
| |
| entity Category { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| id String id |
| var Int categoryParent |
| domainKey String categoryDescription |
| var String categoryRollup |
| ref ExpenseFact [*] expenses opposite category |
| } |
| |
| entity WarehouseClass extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String description |
| ref Warehouse [*] warehouses opposite warehouseClass |
| } |
| |
| entity Customer extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var long accountNum |
| 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 stateProvince |
| var String postalCode |
| var String country |
| var String phone1 |
| var String phone2 |
| var Date birthdate |
| var String maritalStatus |
| var String yearlyIncome |
| var String gender |
| var int totalChildren |
| var int numChildrenAtHome |
| var String education |
| var String dateAccntOpened |
| var String memberCard |
| var String occupation |
| var String houseowner |
| var int numCarsOwned |
| domainKey String fullName |
| var String test |
| ref Region region opposite customers |
| ref SalesFact [*] sales opposite customer |
| } |
| |
| entity Promotion extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var int promotionDistrictId |
| domainKey String promotionName |
| var String mediaType |
| var double cost |
| var Date startDate |
| var Date endDate |
| ref SalesFact [*] sales opposite promotion |
| } |
| |
| entity Salary extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date payDate |
| var double salaryPaid |
| var double overtimePaid |
| var double vacationAccrued |
| var double vacationUsed |
| ref Employee employee opposite salaries |
| ref Department department opposite salaries |
| ref Currency currency opposite salaries |
| @PrePersist |
| def void prepersist () { |
| if ( employee !== null ) { |
| department = employee.department |
| } |
| } |
| } |
| |
| entity Store extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var String storeType |
| domainKey String storeName |
| var int storeNumber |
| var String storeStreetAddress |
| var String storeCity |
| var String storeState |
| var String storePostalCode |
| var String storeCountry |
| var String storeManager |
| var String storePhone |
| var String storeFax |
| var Date firstOpenedDate |
| var Date lastRemodelDate |
| var int storeSqft |
| var int grocerySqft |
| var double frozenSqft |
| var double meatSqft |
| var boolean coffeeBar |
| var boolean videoStore |
| var boolean saladBar |
| var boolean preparedFood |
| var boolean florist |
| ref Region region opposite stores |
| ref Warehouse [*] warehouses opposite store |
| ref Employee [*] employees opposite store |
| ref ReserveEmployee [*] reserveEmployees opposite store |
| ref InventoryFact [*] inventories opposite store |
| ref ExpenseFact [*] expenses opposite store |
| ref SalesFact [*] sales opposite store |
| } |
| |
| entity Employee extends BaseID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var BlobMapping profileImage |
| domainKey String fullName |
| var String firstName |
| var String lastName |
| var String positionTitle |
| var BirthDate birthDate |
| var Date hireDate |
| var Date endDate |
| var double salary |
| var int supervisorId |
| var String educationLevel |
| var String maritalStatus |
| var String [ regex("M|F") ] gender properties(key = "functionImagePicker" value = "${{BASIC_PROJECT_NAME}}.model.functionlibrary.ComboBox.getImagePickerMap") |
| var String managementRole |
| ref Position position opposite employees |
| ref Store store opposite employees |
| ref Department department opposite employees |
| ref EmployeeClosure employeeClosure opposite employees |
| ref Salary [*] salaries opposite employee |
| } |
| |
| entity SalesFact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var double storeSales |
| var double storeCost |
| var double unitSales |
| ref Product product opposite sales |
| ref TimeByDay thattime opposite sales |
| ref Customer customer opposite sales |
| ref Promotion promotion opposite sales |
| ref Store store opposite sales |
| } |
| |
| entity InventoryFact extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var int unitsOrdered |
| var int unitsShipped |
| var double warehouseSales |
| var double warehouseCost |
| var int supplyTime |
| var double storeInvoice |
| ref Product product opposite inventories |
| ref TimeByDay 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 headquarterCity |
| var String headquarterZipcode |
| var String gln |
| var Date lastOrder |
| var boolean locked |
| var String phone |
| var int priority |
| var double yearlyTurnover |
| var String headquarterHousenumber |
| var String headquarterStreetname |
| var Date firstContract |
| var int rating |
| } |
| |
| entity EDIOrders extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| var Date importDate |
| var boolean latest |
| ref EDIOrderHeader [*] orderHeaders opposite headerOrder |
| } |
| |
| 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 EDIOrderCustomer [*] ediOrderCustomer opposite customerHeader |
| ref EDIOrderItem [*] ediOrderItem opposite itemHeader |
| ref EDIOrders headerOrder opposite orderHeaders |
| } |
| |
| entity EDIOrderCustomer extends BaseUUID { |
| persistenceUnit "${{BUSINESSDATA_PERSISTENCE_UNIT}}" |
| domainKey String userName |
| var String firstName |
| var String lastName |
| var String country |
| ref EDIOrderHeader customerHeader 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 itemHeader opposite ediOrderItem |
| } |
| } |