Skip to content

aleksey-stukalov/mssql-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mssql-view

This sample demonstrates two ways of working with views in ms-sql. The same approach can be used for another database.

Overview

The sample has two persistent entities

Each employee belongs to some department.

There are two views declared in the database and 2 corresponding entities:

  1. The AvgHourlyRate entity mapped to the avg_hourly_rate DB view - shows the average hourly rate between all employees in the department
  • Mapping works through the standard CUBA mechanism
  • The only restriction of the approach is that the view must have id field
  1. The DepartmentSize entity mapped to the department_size DB view (shows how many employees work in the department) by the EntityQuery and QueryField annotations

Using TsqlQueryDatasource

Define a datasource in your screen (as it is shown here) and then you can specify it for any data-aware UI component in CUBA (for example it is shown here).

About

Demonstrates how to work with MS SQL views

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages