title: How to map one table and two derived views to entities?
body: <p>Let us say we have for an Spring Boot-Application a SQL Server table with name <code>FiscalPeriod</code>:</p>
  <pre><code>create table fiscal
  (
      mydate                date,
      Calender              varchar(7),
      Fiscalyear            varchar(8),
      Fiscalmonth           int,
      Fiscalquarter         varchar(11),
      Fiscalperiod          varchar(11)
  )
  </code></pre>
  <p>From this table I have created two views.
  The first view is grouped by <code>Fiscalyear</code>:</p>
  <pre><code>Create View FiscalToYear
  AS
  Select min(mydate) as min, max(mydate) as max, Fiscalyear
  from fiscal f
  WHERE g.mydate &lt; CONCAT(YEAR(GETDATE()), '-', MONTH(GETDATE()), '-01')
  GROUP BY Fiscalyear;
  go
  </code></pre>
  <p>The second view is grouped by <code>Fiscalmonth</code> and <code>Fiscalyear</code>:</p>
  <pre><code>Create View FiscalToMonth
  AS
  SELECT min(mydate) as min, max(mydate) as max, Fiscalmonth, Fiscalyear
  FROM fiscal f
  GROUP BY f.fiscalmonth, f.fiscalyear;
  </code></pre>
  <p>Should have each table and view have its own Entity, although the view <code>FiscalToYear</code> and <code>FiscalToMonth</code> differs only by one column (`Fiscalmonth)?</p>
  <p>What is best way to map these tables to Entities?</p>
  <p>Thanks for all help.</p>