<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="TestingModel" Alias="Self" p1:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:p1="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
  <EntityContainer Name="DatabaseEntities" p1:LazyLoadingEnabled="true">
    <EntitySet Name="Predmet" EntityType="TestingModel.Predmet" />
    <EntitySet Name="Ucitel" EntityType="TestingModel.Ucitel" />
    <EntitySet Name="Ustav" EntityType="TestingModel.Ustav" />
    <AssociationSet Name="FK_Predmet_Katedra" Association="TestingModel.FK_Predmet_Katedra">
      <End Role="Ustav" EntitySet="Ustav" />
      <End Role="Predmet" EntitySet="Predmet" />
    </AssociationSet>
    <AssociationSet Name="FK_Ucitel_Ucitel" Association="TestingModel.FK_Ucitel_Ucitel">
      <End Role="Ucitel" EntitySet="Ucitel" />
      <End Role="Ucitel1" EntitySet="Ucitel" />
    </AssociationSet>
    <AssociationSet Name="FK_Ucitel_Ustav" Association="TestingModel.FK_Ucitel_Ustav">
      <End Role="Ustav" EntitySet="Ustav" />
      <End Role="Ucitel" EntitySet="Ucitel" />
    </AssociationSet>
    <AssociationSet Name="UctitelPredmet" Association="TestingModel.UctitelPredmet">
      <End Role="Predmet" EntitySet="Predmet" />
      <End Role="Ucitel" EntitySet="Ucitel" />
    </AssociationSet>
  </EntityContainer>
  <EntityType Name="Predmet">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Type="Int32" Nullable="false" p1:StoreGeneratedPattern="Identity" />
    <Property Name="Nazev" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
    <Property Name="Zkratka" Type="String" Nullable="false" MaxLength="4" Unicode="false" FixedLength="true" />
    <Property Name="PocetKreditu" Type="Byte" Nullable="false" />
    <Property Name="Popis" Type="String" Nullable="false" MaxLength="Max" Unicode="true" FixedLength="false" />
    <Property Name="UstavId" Type="Int32" Nullable="false" />
    <NavigationProperty Name="Ustav" Relationship="TestingModel.FK_Predmet_Katedra" FromRole="Predmet" ToRole="Ustav" />
    <NavigationProperty Name="Ucitele" Relationship="TestingModel.UctitelPredmet" FromRole="Predmet" ToRole="Ucitel" />
  </EntityType>
  <EntityType Name="Ucitel">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Type="Int32" Nullable="false" />
    <Property Name="Krestni" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
    <Property Name="Prijmeni" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
    <Property Name="DatumNarozeni" Type="DateTime" Nullable="false" Precision="3" />
    <Property Name="Plat" Type="Decimal" Nullable="false" Precision="18" Scale="0" />
    <Property Name="ProstredniJmeno" Type="String" MaxLength="50" Unicode="true" FixedLength="false" />
    <Property Name="UstavId" Type="Int32" Nullable="false" />
    <Property Name="NadrizenyId" Type="Int32" />
    <NavigationProperty Name="Podrizeni" Relationship="TestingModel.FK_Ucitel_Ucitel" FromRole="Ucitel" ToRole="Ucitel1" />
    <NavigationProperty Name="Nadrizeny" Relationship="TestingModel.FK_Ucitel_Ucitel" FromRole="Ucitel1" ToRole="Ucitel" />
    <NavigationProperty Name="Ustav" Relationship="TestingModel.FK_Ucitel_Ustav" FromRole="Ucitel" ToRole="Ustav" />
    <NavigationProperty Name="Predmety" Relationship="TestingModel.UctitelPredmet" FromRole="Ucitel" ToRole="Predmet" />
  </EntityType>
  <EntityType Name="Ustav">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Type="Int32" Nullable="false" p1:StoreGeneratedPattern="Identity" />
    <Property Name="Nazev" Type="String" Nullable="false" MaxLength="150" Unicode="true" FixedLength="false" />
    <Property Name="Zkratka" Type="String" Nullable="false" MaxLength="4" Unicode="true" FixedLength="true" />
    <NavigationProperty Name="Predmety" Relationship="TestingModel.FK_Predmet_Katedra" FromRole="Ustav" ToRole="Predmet" />
    <NavigationProperty Name="Ucitele" Relationship="TestingModel.FK_Ucitel_Ustav" FromRole="Ustav" ToRole="Ucitel" />
  </EntityType>
  <Association Name="FK_Predmet_Katedra">
    <End Role="Ustav" Type="TestingModel.Ustav" Multiplicity="1" />
    <End Role="Predmet" Type="TestingModel.Predmet" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Ustav">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Predmet">
        <PropertyRef Name="UstavId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Ucitel_Ucitel">
    <End Role="Ucitel" Type="TestingModel.Ucitel" Multiplicity="0..1" />
    <End Role="Ucitel1" Type="TestingModel.Ucitel" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Ucitel">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Ucitel1">
        <PropertyRef Name="NadrizenyId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Ucitel_Ustav">
    <End Role="Ustav" Type="TestingModel.Ustav" Multiplicity="1" />
    <End Role="Ucitel" Type="TestingModel.Ucitel" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Ustav">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Ucitel">
        <PropertyRef Name="UstavId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="UctitelPredmet">
    <End Role="Predmet" Type="TestingModel.Predmet" Multiplicity="*" />
    <End Role="Ucitel" Type="TestingModel.Ucitel" Multiplicity="*" />
  </Association>
</Schema>