<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:PapyrusJava="http://www.eclipse.org/papyrus/PapyrusJava/1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
  <uml:Model xmi:id="_Y_CFIOCIEeakJtU5f6kHGA" name="RootElement">
    <packagedElement xmi:type="uml:Package" xmi:id="_mfYrwOCIEeakJtU5f6kHGA" name="IT-Projekt">
      <packagedElement xmi:type="uml:Package" xmi:id="_mgthcOCIEeakJtU5f6kHGA" name="de">
        <packagedElement xmi:type="uml:Package" xmi:id="_mguIgOCIEeakJtU5f6kHGA" name="hdm_stuttgart">
          <packagedElement xmi:type="uml:Package" xmi:id="_mguIgeCIEeakJtU5f6kHGA" name="huber">
            <packagedElement xmi:type="uml:Package" xmi:id="_mguvkOCIEeakJtU5f6kHGA" name="itprojekt">
              <packagedElement xmi:type="uml:Package" xmi:id="_mguvkeCIEeakJtU5f6kHGA" name="server">
                <packagedElement xmi:type="uml:Package" xmi:id="_mguvkuCIEeakJtU5f6kHGA" name="db">
                  <packagedElement xmi:type="uml:Class" xmi:id="_mgwkwOCIEeakJtU5f6kHGA" name="NoteBookMapper" visibility="public">
                    <generalization xmi:type="uml:Generalization" xmi:id="_mgxL0OCIEeakJtU5f6kHGA" general="_mgwkweCIEeakJtU5f6kHGA"/>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mgxL0eCIEeakJtU5f6kHGA" name="noteBookMapper" visibility="private" isStatic="true" type="_mgwkwOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mgxy4OCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>null</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mkGzseCIEeakJtU5f6kHGA" name="NoteBookMapper" specification="_mgxy4eCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    super();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mkHawuCIEeakJtU5f6kHGA" name="getNoteBookMapper" specification="_mkHawOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (noteBookMapper == null) {&#xD;
        try {&#xD;
            noteBookMapper = new NoteBookMapper();&#xD;
        } catch (ClassNotFoundExceptionSQLException |  e) {&#xD;
            e.printStackTrace();&#xD;
        }&#xD;
    }&#xD;
    return noteBookMapper;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mkOIcOCIEeakJtU5f6kHGA" name="create" specification="_mkLFIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;INSERT INTO notizbuch.notebook(title, subtitle, creation_date, modification_date, author_id) &quot; + &quot;VALUES (?,?,?,?,?)&quot;, Statement.RETURN_GENERATED_KEYS);&#xD;
        stmt.setString(1, notebook.getTitle());&#xD;
        stmt.setString(2, notebook.getSubtitle());&#xD;
        stmt.setDate(3, notebook.getCreationDate());&#xD;
        stmt.setDate(4, notebook.getModificationDate());&#xD;
        stmt.setInt(5, notebook.getOwner().getId());&#xD;
        stmt.executeUpdate();&#xD;
        ResultSet rs = stmt.getGeneratedKeys();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getLong(1));&#xD;
        }&#xD;
    } catch (SQLExceptionClassNotFoundException |  sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
    return notebook;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mknKAOCIEeakJtU5f6kHGA" name="findById" specification="_mkcx8OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection connection = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;SELECT * FROM notizbuch.notebook WHERE id = ?&quot;);&#xD;
        stmt.setLong(1, id);&#xD;
        ResultSet rs = stmt.executeQuery();&#xD;
        if (rs.next()) {&#xD;
            return new NoteBook(rs.getInt(&quot;id&quot;), rs.getString(&quot;title&quot;), rs.getString(&quot;subtitle&quot;), UserInfoMapper.getUserInfoMapper().findById(rs.getInt(&quot;author_id&quot;)), rs.getDate(&quot;creation_date&quot;), rs.getDate(&quot;modification_date&quot;));&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mk3osOCIEeakJtU5f6kHGA" name="save" specification="_mkrbcOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;UPDATE notizbuch.notebook SET title=?, subtitle=?, creation_date=?, modification_date=?, author_id=? WHERE id = ?&quot;);&#xD;
        stmt.setString(1, notebook.getTitle());&#xD;
        stmt.setString(2, notebook.getSubtitle());&#xD;
        stmt.setDate(3, notebook.getCreationDate());&#xD;
        stmt.setDate(4, new Date(System.currentTimeMillis()));&#xD;
        stmt.setInt(5, notebook.getOwner().getId());&#xD;
        stmt.setInt(6, notebook.getId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        throw new IllegalArgumentException();&#xD;
    }&#xD;
    return findById(notebook.getId());&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlALkOCIEeakJtU5f6kHGA" name="delete" specification="_mk76IOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;DELETE FROM notizbuch.notebook WHERE id = ?&quot;);&#xD;
        stmt.setInt(1, notebook.getId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
        throw new IllegalArgumentException(e);&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlM_4OCIEeakJtU5f6kHGA" name="getAllNoteBooks" specification="_mlFEEOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        Statement stmt = connection.createStatement();&#xD;
        ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM notizbuch.notebook&quot;);&#xD;
        return makeNoteBooksFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlRRUOCIEeakJtU5f6kHGA" name="getAllNoteBooksForUserId" specification="_mlOOAOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;SELECT * FROM notizbuch.notebook WHERE author_id = ?&quot;);&#xD;
        ps.setInt(1, userId);&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        return makeNoteBooksFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlbCUOCIEeakJtU5f6kHGA" name="getAllNoteBooksSharedWith" specification="_mlWw4OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        String sql = &quot;SELECT notebook.id AS id, title, subtitle, creation_date, modification_date, notebook.author_id AS author_id FROM notebook &quot; + &quot;JOIN permission ON notebook.id = permission.notebook_id WHERE beneficiary_id = ?&quot;;&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, u.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        return makeNoteBooksFromResultSet(rs);&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
        return new Vector&lt;>();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlkzUOCIEeakJtU5f6kHGA" name="makeNoteBooksFromResultSet" specification="_mlfTwOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;NoteBook> v = new Vector&lt;>();&#xD;
    while (rs.next()) {&#xD;
        NoteBook resultRow = new NoteBook(rs.getInt(&quot;id&quot;));&#xD;
        resultRow.setTitle(rs.getString(&quot;title&quot;));&#xD;
        resultRow.setSubtitle(rs.getString(&quot;subtitle&quot;));&#xD;
        resultRow.setCreationDate(rs.getDate(&quot;creation_date&quot;));&#xD;
        resultRow.setModificationDate(rs.getDate(&quot;modification_date&quot;));&#xD;
        resultRow.setOwner(UserInfoMapper.getUserInfoMapper().findById(rs.getInt(&quot;author_id&quot;)));&#xD;
        v.add(resultRow);&#xD;
    }&#xD;
    return v;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mlpr0OCIEeakJtU5f6kHGA" name="getAllNoteBooksSharedBy" specification="_mlmBcOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    String sql = &quot;SELECT DISTINCT notebook.id AS id FROM notebook JOIN permission ON notebook.id = permission.notebook_id WHERE notebook.author_id = ?&quot;;&#xD;
    Vector&lt;NoteBook> v = new Vector&lt;>();&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, u.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        while (rs.next()) {&#xD;
            v.add(findById(rs.getInt(&quot;id&quot;)));&#xD;
        }&#xD;
        return v;&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
        return v;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mgxy4eCIEeakJtU5f6kHGA" name="NoteBookMapper" visibility="protected" method="_mkGzseCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _mkE-g-CIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mkHawOCIEeakJtU5f6kHGA" name="getNoteBookMapper" visibility="public" isStatic="true" method="_mkHawuCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkHaweCIEeakJtU5f6kHGA" type="_mgwkwOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mkLFIOCIEeakJtU5f6kHGA" name="create" visibility="public" method="_mkOIcOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkLsMOCIEeakJtU5f6kHGA" type="_mkIo4eCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkM6UOCIEeakJtU5f6kHGA" name="notebook" type="_mkIo4eCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mkcx8OCIEeakJtU5f6kHGA" name="findById" visibility="public" method="_mknKAOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _mkE-g-CIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkf1QOCIEeakJtU5f6kHGA" type="_mkIo4eCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkhqcOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_8heigBydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mkrbcOCIEeakJtU5f6kHGA" name="save" visibility="public" method="_mk3osOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _mkE-g-CIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkvF0OCIEeakJtU5f6kHGA" type="_mkIo4eCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mkywMOCIEeakJtU5f6kHGA" name="notebook" type="_mkIo4eCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mk76IOCIEeakJtU5f6kHGA" name="delete" visibility="public" method="_mlALkOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mk-WYOCIEeakJtU5f6kHGA" name="notebook" type="_mkIo4eCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mlFEEOCIEeakJtU5f6kHGA" name="getAllNoteBooks" visibility="public" method="_mlM_4OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlMY0OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mlOOAOCIEeakJtU5f6kHGA" name="getAllNoteBooksForUserId" visibility="public" method="_mlRRUOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlPcIOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlQqQOCIEeakJtU5f6kHGA" name="userId">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mlWw4OCIEeakJtU5f6kHGA" name="getAllNoteBooksSharedWith" visibility="public" method="_mlbCUOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlX_AOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlZ0MOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mlfTwOCIEeakJtU5f6kHGA" name="makeNoteBooksFromResultSet" visibility="private" method="_mlkzUOCIEeakJtU5f6kHGA" raisedException="_mkE-g-CIEeakJtU5f6kHGA _mkB7MOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlgh4OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlhwAOCIEeakJtU5f6kHGA" name="rs" type="_mlcQcOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mlmBcOCIEeakJtU5f6kHGA" name="getAllNoteBooksSharedBy" visibility="public" method="_mlpr0OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlmogOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mlodsOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mgwkweCIEeakJtU5f6kHGA" name="DataMapper" visibility="public" isAbstract="true">
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_morKoOCIEeakJtU5f6kHGA" name="loadedObjects" visibility="protected" type="_mooHUOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mos_0OCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>new HashMap&lt;>()</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mou1AOCIEeakJtU5f6kHGA" name="connection" visibility="protected" type="_moRiAOCIEeakJtU5f6kHGA" isUnique="false"/>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mo0UkOCIEeakJtU5f6kHGA" name="DataMapper" specification="_mowDIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    connection = DBConnection.getConnection();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mo8QYOCIEeakJtU5f6kHGA" name="isObjectLoaded" specification="_mo5NEOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Object o = loadedObjects.get(id);&#xD;
    return o != null &amp;&amp; classToCheck.isAssignableFrom(o.getClass());&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mo-soOCIEeakJtU5f6kHGA" name="finalize" specification="_mo9egOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    super.finalize();&#xD;
    connection.close();&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mowDIOCIEeakJtU5f6kHGA" name="DataMapper" visibility="protected" method="_mo0UkOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _mkE-g-CIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mo5NEOCIEeakJtU5f6kHGA" name="isObjectLoaded" visibility="protected" method="_mo8QYOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mo50IOCIEeakJtU5f6kHGA" direction="return">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_vAIV4I7PEdySGvm5GN66HA"/>
                      </ownedParameter>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mo6bMOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_8heigBydEduyofBvg4RL2w"/>
                      </ownedParameter>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mo7pUOCIEeakJtU5f6kHGA" name="classToCheck" type="_mo2JwOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mo9egOCIEeakJtU5f6kHGA" name="finalize" visibility="protected" method="_mo-soOCIEeakJtU5f6kHGA" raisedException="_mofkcOCIEeakJtU5f6kHGA"/>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mkB7MOCIEeakJtU5f6kHGA" name="ClassNotFoundException"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mlxnoOCIEeakJtU5f6kHGA" name="UserInfoMapper" visibility="public">
                    <generalization xmi:type="uml:Generalization" xmi:id="_mly1wOCIEeakJtU5f6kHGA" general="_mgwkweCIEeakJtU5f6kHGA"/>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_ml0q8OCIEeakJtU5f6kHGA" name="userInfoMapper" visibility="private" isStatic="true" type="_mlxnoOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_ml15EOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>null</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_ml904OCIEeakJtU5f6kHGA" name="UserInfoMapper" specification="_ml2gIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmA4MOCIEeakJtU5f6kHGA" name="getUserInfoMapper" specification="_ml_DAOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (userInfoMapper == null) {&#xD;
        try {&#xD;
            userInfoMapper = new UserInfoMapper();&#xD;
        } catch (ClassNotFoundException e) {&#xD;
            throw new RuntimeException(e.toString());&#xD;
        } catch (SQLException e) {&#xD;
            throw new RuntimeException(e.toString());&#xD;
        }&#xD;
    }&#xD;
    return userInfoMapper;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmFwsOCIEeakJtU5f6kHGA" name="create" specification="_mmCGUOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;INSERT INTO userinfo(FirstName, UserName, SurName, Email, GoogleId) VALUES (?, ?, ?, ?, ?)&quot;, Statement.RETURN_GENERATED_KEYS);&#xD;
        stmt.setString(1, noteUser.getFirstName());&#xD;
        stmt.setString(2, noteUser.getNickname());&#xD;
        stmt.setString(3, noteUser.getSurName());&#xD;
        stmt.setString(4, noteUser.getEmailAddress());&#xD;
        stmt.setString(5, noteUser.getGoogleId());&#xD;
        stmt.executeUpdate();&#xD;
        ResultSet rs = stmt.getGeneratedKeys();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getInt(1));&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
    return noteUser;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmLQQOCIEeakJtU5f6kHGA" name="findById" specification="_mmG-0OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;SELECT * FROM notizbuch.userinfo WHERE id = ?&quot;);&#xD;
        stmt.setInt(1, id);&#xD;
        // Ergebnis holen&#xD;
        ResultSet results = stmt.executeQuery();&#xD;
        if (results.next()) {&#xD;
            UserInfo noteUser = new UserInfo(results.getInt(&quot;id&quot;), results.getString(&quot;firstname&quot;), results.getString(&quot;username&quot;), results.getString(&quot;lastname&quot;), results.getString(&quot;email&quot;), results.getString(&quot;google_id&quot;));&#xD;
            return noteUser;&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmRW4OCIEeakJtU5f6kHGA" name="save" specification="_mmNFcOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        String sql = &quot;UPDATE notizbuch.userinfo SET username = ?, firstname = ?, lastname = ?, email = ? WHERE google_id = ?&quot;;&#xD;
        PreparedStatement stmt = connection.prepareStatement(sql);&#xD;
        stmt.setString(1, userToSave.getNickname());&#xD;
        stmt.setString(2, userToSave.getFirstName());&#xD;
        stmt.setString(3, userToSave.getSurName());&#xD;
        stmt.setString(4, userToSave.getEmailAddress());&#xD;
        stmt.setString(5, userToSave.getGoogleId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        throw new IllegalArgumentException();&#xD;
    }&#xD;
    return findById(userToSave.getId());&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmYEkOCIEeakJtU5f6kHGA" name="delete" specification="_mmVBQOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;DELETE FROM notizbuch.userinfo WHERE id = ?&quot;);&#xD;
        stmt.setLong(1, noteUser.getId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        throw new IllegalArgumentException();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmcWAOCIEeakJtU5f6kHGA" name="getAllNoteUser" specification="_mmZSsOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    Vector&lt;UserInfo> result = new Vector&lt;>();&#xD;
    try {&#xD;
        // wieso kein prepared Statement mehr?&#xD;
        // PreparedStatement stmt = con.prepareStatement(&quot;SELECT NoteUserId&#xD;
        // FROM NoteUser&quot;);&#xD;
        Statement stmt = con.createStatement();&#xD;
        ResultSet results = stmt.executeQuery(&quot;SELECT * FROM notizbuch.userinfo&quot;);&#xD;
        while (results.next()) {&#xD;
            UserInfo noteUser = new UserInfo(results.getInt(&quot;id&quot;), results.getString(&quot;firstname&quot;), results.getString(&quot;username&quot;), results.getString(&quot;lastname&quot;), results.getString(&quot;email&quot;), results.getString(&quot;google_id&quot;));&#xD;
            result.add(noteUser);&#xD;
        }&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return result;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmk44OCIEeakJtU5f6kHGA" name="isUserRegistered" specification="_mmh1kOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;SELECT EXISTS(SELECT * FROM notizbuch.userinfo WHERE email = ?) AS does_exist&quot;);&#xD;
        ps.setString(1, email);&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        if (rs.next()) {&#xD;
            return rs.getBoolean(&quot;does_exist&quot;);&#xD;
        }&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
        throw new RuntimeException(e.toString());&#xD;
    }&#xD;
    return false;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmn8MOCIEeakJtU5f6kHGA" name="registerUser" specification="_mmmHAOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;INSERT INTO notizbuch.userinfo(username, email, google_id)&quot; + &quot; VALUES (?, ?, ?)&quot;);&#xD;
        ps.setString(1, u.getNickname());&#xD;
        ps.setString(2, u.getEmailAddress());&#xD;
        ps.setString(3, u.getGoogleId());&#xD;
        ps.executeUpdate();&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
        throw new RuntimeException(e.toString());&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmtbwOCIEeakJtU5f6kHGA" name="findUserByGoogleId" specification="_mmqYcOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareCall(&quot;SELECT id FROM notizbuch.userinfo WHERE google_id = ?&quot;);&#xD;
        ps.setString(1, googleId);&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getInt(&quot;id&quot;));&#xD;
        } else {&#xD;
            throw new IllegalArgumentException(&quot;Logikfehler: Kein User gefunden&quot;);&#xD;
        }&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mmyUQOCIEeakJtU5f6kHGA" name="findByEmailAdress" specification="_mmup4OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareCall(&quot;SELECT id FROM notizbuch.userinfo WHERE email = ?&quot;);&#xD;
        ps.setString(1, email);&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getInt(&quot;id&quot;));&#xD;
        } else {&#xD;
            return null;&#xD;
        }&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mm0wgOCIEeakJtU5f6kHGA" name="getAllEmailAdresses" specification="_mmziYOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;String> v = new Vector&lt;>();&#xD;
    try {&#xD;
        Statement s = connection.createStatement();&#xD;
        ResultSet rs = s.executeQuery(&quot;SELECT email FROM notizbuch.userinfo&quot;);&#xD;
        while (rs.next()) {&#xD;
            v.add(rs.getString(&quot;email&quot;));&#xD;
        }&#xD;
        return v;&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return v;&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_ml2gIOCIEeakJtU5f6kHGA" name="UserInfoMapper" visibility="protected" method="_ml904OCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_ml_DAOCIEeakJtU5f6kHGA" name="getUserInfoMapper" visibility="public" isStatic="true" method="_mmA4MOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_ml_qEOCIEeakJtU5f6kHGA" type="_mlxnoOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmCGUOCIEeakJtU5f6kHGA" name="create" visibility="public" method="_mmFwsOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmDUcOCIEeakJtU5f6kHGA" type="_mlTGgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmD7gOCIEeakJtU5f6kHGA" name="noteUser" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmG-0OCIEeakJtU5f6kHGA" name="findById" visibility="public" method="_mmLQQOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmIM8OCIEeakJtU5f6kHGA" type="_mlTGgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmI0AOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmNFcOCIEeakJtU5f6kHGA" name="save" visibility="public" method="_mmRW4OCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmOTkOCIEeakJtU5f6kHGA" type="_mlTGgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmPhsOCIEeakJtU5f6kHGA" name="userToSave" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmVBQOCIEeakJtU5f6kHGA" name="delete" visibility="public" method="_mmYEkOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmVoUOCIEeakJtU5f6kHGA" name="noteUser" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmZSsOCIEeakJtU5f6kHGA" name="getAllNoteUser" visibility="public" method="_mmcWAOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmag0OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmh1kOCIEeakJtU5f6kHGA" name="isUserRegistered" visibility="public" method="_mmk44OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmjDsOCIEeakJtU5f6kHGA" direction="return">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_vAIV4I7PEdySGvm5GN66HA"/>
                      </ownedParameter>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmjqwOCIEeakJtU5f6kHGA" name="email" type="_mmeyQOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmmHAOCIEeakJtU5f6kHGA" name="registerUser" visibility="public" method="_mmn8MOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmmuEOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmqYcOCIEeakJtU5f6kHGA" name="findUserByGoogleId" visibility="public" method="_mmtbwOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmrmkOCIEeakJtU5f6kHGA" type="_mlTGgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mms0sOCIEeakJtU5f6kHGA" name="googleId" type="_mmeyQOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmup4OCIEeakJtU5f6kHGA" name="findByEmailAdress" visibility="public" method="_mmyUQOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmv4AOCIEeakJtU5f6kHGA" type="_mlTGgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mmxGIOCIEeakJtU5f6kHGA" name="email" type="_mmeyQOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mmziYOCIEeakJtU5f6kHGA" name="getAllEmailAdresses" visibility="public" method="_mm0wgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mm0JcOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_ml6KgOCIEeakJtU5f6kHGA" name="SQLException"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mm8sUOCIEeakJtU5f6kHGA" name="PermissionMapper" visibility="public">
                    <generalization xmi:type="uml:Generalization" xmi:id="_mm9TYOCIEeakJtU5f6kHGA" general="_mgwkweCIEeakJtU5f6kHGA"/>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mm-hgOCIEeakJtU5f6kHGA" name="permissionMapper" visibility="private" isStatic="true" type="_mm8sUOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mm_IkOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>null</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnEBEOCIEeakJtU5f6kHGA" name="PermissionMapper" specification="_mm_voOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    super();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnHEYOCIEeakJtU5f6kHGA" name="getPermissionMapper" specification="_mnF2QOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (permissionMapper == null) {&#xD;
        try {&#xD;
            permissionMapper = new PermissionMapper();&#xD;
        } catch (ClassNotFoundException e) {&#xD;
            e.printStackTrace();&#xD;
        } catch (SQLException e) {&#xD;
            e.printStackTrace();&#xD;
        }&#xD;
    }&#xD;
    return permissionMapper;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnTRoOCIEeakJtU5f6kHGA" name="getPermissionFor" specification="_mnL84OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    StringBuilder sql = new StringBuilder();&#xD;
    sql.append(&quot;SELECT * FROM notizbuch.permission WHERE beneficiary_id = ? AND &quot;);&#xD;
    if (sharedObject instanceof Note) {&#xD;
        sql.append(&quot;note_id = ?;&quot;);&#xD;
    } else if (sharedObject instanceof NoteBook) {&#xD;
        sql.append(&quot;notebook_id = ?;&quot;);&#xD;
    } else {&#xD;
        throw new RuntimeException(&quot;Das war der falsche Datentyp&quot;);&#xD;
    }&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql.toString());&#xD;
        ps.setInt(1, u.getId());&#xD;
        ps.setInt(2, sharedObject.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        // Workaround, eventuelle makeFrom-Methode refactoren?&#xD;
        Vector&lt;Permission> v = makeFromResultSet(rs);&#xD;
        if (v.size() != 0) {&#xD;
            return v.firstElement();&#xD;
        } else {&#xD;
            return null;&#xD;
        }&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnWU8OCIEeakJtU5f6kHGA" name="createPermission" specification="_mnUfwOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    String sql = &quot;INSERT INTO notizbuch.permission(author_id, permission_level, type, :targetid, beneficiary_id) VALUES (?, ?, ?, ?, ?)&quot;;&#xD;
    String replaceString;&#xD;
    switch(p.getSharedObject().getType()) {&#xD;
        case 'b':&#xD;
            replaceString = &quot;notebook_id&quot;;&#xD;
            break;&#xD;
        case 'n':&#xD;
            replaceString = &quot;note_id&quot;;&#xD;
            break;&#xD;
        default:&#xD;
            throw new RuntimeException(&quot;Invalid Type for current database configuration!&quot;);&#xD;
    }&#xD;
    sql = sql.replaceAll(&quot;:targetid&quot;, replaceString);&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, p.getAuthor().getId());&#xD;
        ps.setInt(2, p.getLevelAsInt());&#xD;
        ps.setString(3, Character.toString(p.getSharedObject().getType()));&#xD;
        ps.setInt(4, p.getSharedObject().getId());&#xD;
        ps.setInt(5, p.getBeneficiary().getId());&#xD;
        ps.executeUpdate();&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnamYOCIEeakJtU5f6kHGA" name="getAllPermissionsFor" specification="_mnXjEOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;Permission> v = new Vector&lt;>();&#xD;
    String sql = &quot;SELECT * FROM notizbuch.permission WHERE :targetTable = ?&quot;;&#xD;
    String replaceString;&#xD;
    switch(s.getType()) {&#xD;
        case 'b':&#xD;
            replaceString = &quot;notebook_id&quot;;&#xD;
            break;&#xD;
        case 'n':&#xD;
            replaceString = &quot;note_id&quot;;&#xD;
            break;&#xD;
        default:&#xD;
            throw new RuntimeException(&quot;Invalid Shareable&quot;);&#xD;
    }&#xD;
    sql = sql.replaceAll(&quot;:targetTable&quot;, replaceString);&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, s.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        return makeFromResultSet(rs);&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return v;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnh7IOCIEeakJtU5f6kHGA" name="makeFromResultSet" specification="_mne30OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;Permission> v = new Vector&lt;>();&#xD;
    while (rs.next()) {&#xD;
        Level l;&#xD;
        switch(rs.getInt(&quot;permission_level&quot;)) {&#xD;
            case 10:&#xD;
                l = Level.READ;&#xD;
                break;&#xD;
            case 20:&#xD;
                l = Level.EDIT;&#xD;
                break;&#xD;
            case 30:&#xD;
                l = Level.DELETE;&#xD;
                break;&#xD;
            default:&#xD;
                l = Level.NONE;&#xD;
        }&#xD;
        Permission p = new Permission(rs.getInt(&quot;id&quot;), l);&#xD;
        UserInfoMapper uim = UserInfoMapper.getUserInfoMapper();&#xD;
        NoteMapper nm = NoteMapper.getNoteMapper();&#xD;
        NoteBookMapper nbm = NoteBookMapper.getNoteBookMapper();&#xD;
        p.setBeneficiary(uim.findById(rs.getInt(&quot;beneficiary_id&quot;)));&#xD;
        p.setAuthor(uim.findById(rs.getInt(&quot;author_id&quot;)));&#xD;
        Shareable sharedObject;&#xD;
        char type = rs.getString(&quot;type&quot;).charAt(0);&#xD;
        int id;&#xD;
        switch(type) {&#xD;
            case 'b':&#xD;
                id = rs.getInt(&quot;notebook_id&quot;);&#xD;
                sharedObject = nbm.findById(id);&#xD;
                break;&#xD;
            case 'n':&#xD;
                id = rs.getInt(&quot;note_id&quot;);&#xD;
                sharedObject = nm.findById(id);&#xD;
                break;&#xD;
            default:&#xD;
                throw new RuntimeException();&#xD;
        }&#xD;
        p.setSharedObject(sharedObject);&#xD;
        v.add(p);&#xD;
    }&#xD;
    return v;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnmMkOCIEeakJtU5f6kHGA" name="getAllPermissionsCreatedBy" specification="_mnjwUOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;SELECT * FROM notizbuch.permission &quot; + &quot;WHERE author_id = ?&quot;);&#xD;
        ps.setInt(1, u.getId());&#xD;
        return makeFromResultSet(ps.executeQuery());&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnqeAOCIEeakJtU5f6kHGA" name="getAllPermissionsFor" specification="_mnoBwOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;SELECT * FROM notizbuch.permission &quot; + &quot;WHERE beneficiary_id = ?&quot;);&#xD;
        ps.setInt(1, u.getId());&#xD;
        return makeFromResultSet(ps.executeQuery());&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnthUOCIEeakJtU5f6kHGA" name="savePermission" specification="_mnrsIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;UPDATE notizbuch.permission SET permission_level = ? WHERE id = ?&quot;);&#xD;
        ps.setInt(1, p.getLevelAsInt());&#xD;
        ps.setInt(2, p.getId());&#xD;
        ps.executeUpdate();&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mnxLsOCIEeakJtU5f6kHGA" name="deletePermission" specification="_mnvWgOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    String sql = &quot;DELETE FROM notizbuch.permission WHERE id = ?&quot;;&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, p.getId());&#xD;
        ps.executeUpdate();&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mn0PAOCIEeakJtU5f6kHGA" name="getAllPermissions" specification="_mnyZ0OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Statement s;&#xD;
    try {&#xD;
        s = connection.createStatement();&#xD;
        ResultSet rs = s.executeQuery(&quot;SELECT * FROM notizbuch.permission&quot;);&#xD;
        return makeFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mm_voOCIEeakJtU5f6kHGA" name="PermissionMapper" visibility="protected" method="_mnEBEOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnF2QOCIEeakJtU5f6kHGA" name="getPermissionMapper" visibility="public" isStatic="true" method="_mnHEYOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnGdUOCIEeakJtU5f6kHGA" type="_mm8sUOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnL84OCIEeakJtU5f6kHGA" name="getPermissionFor" visibility="public" method="_mnTRoOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnQOUOCIEeakJtU5f6kHGA" type="_mnNLAOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnRccOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnSDgOCIEeakJtU5f6kHGA" name="sharedObject" type="_mnJgoOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnUfwOCIEeakJtU5f6kHGA" name="createPermission" visibility="public" method="_mnWU8OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnVt4OCIEeakJtU5f6kHGA" name="p" type="_mnNLAOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnXjEOCIEeakJtU5f6kHGA" name="getAllPermissionsFor" visibility="public" method="_mnamYOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnYxMOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnZ_UOCIEeakJtU5f6kHGA" name="s" type="_mnJgoOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mne30OCIEeakJtU5f6kHGA" name="makeFromResultSet" visibility="public" method="_mnh7IOCIEeakJtU5f6kHGA" raisedException="_ml6KgOCIEeakJtU5f6kHGA _mkB7MOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnfe4OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mngtAOCIEeakJtU5f6kHGA" name="rs" type="_mnb0gOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnjwUOCIEeakJtU5f6kHGA" name="getAllPermissionsCreatedBy" visibility="public" method="_mnmMkOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnkXYOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnllgOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnoBwOCIEeakJtU5f6kHGA" name="getAllPermissionsFor" visibility="public" method="_mnqeAOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnoo0OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnp28OCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnrsIOCIEeakJtU5f6kHGA" name="savePermission" visibility="public" method="_mnthUOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mns6QOCIEeakJtU5f6kHGA" name="p" type="_mnNLAOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnvWgOCIEeakJtU5f6kHGA" name="deletePermission" visibility="public" method="_mnxLsOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnwkoOCIEeakJtU5f6kHGA" name="p" type="_mnNLAOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mnyZ0OCIEeakJtU5f6kHGA" name="getAllPermissions" visibility="public" method="_mn0PAOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mnzn8OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mnb0gOCIEeakJtU5f6kHGA" name="ResultSet"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mn3SUOCIEeakJtU5f6kHGA" name="GoogleCredentials" visibility="public">
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mn4gcOCIEeakJtU5f6kHGA" name="GOOGLE_URL" visibility="public" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mn6VoOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mn8K0OCIEeakJtU5f6kHGA" name="GOOGLE_USER" visibility="public" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mn-AAOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mn_1MOCIEeakJtU5f6kHGA" name="GOOGLE_PASS" visibility="public" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_moBDUOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_moEtsOCIEeakJtU5f6kHGA" name="DBConnection" visibility="public">
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_moGi4OCIEeakJtU5f6kHGA" name="JDBC_DRIVER" visibility="private" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_moHJ8OCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;com.mysql.jdbc.Driver&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_moIYEOCIEeakJtU5f6kHGA" name="DB_URL" visibility="private" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_moKNQOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;jdbc:mysql://localhost/notizbuch&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_moLbYOCIEeakJtU5f6kHGA" name="USER" visibility="private" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_moNQkOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;root&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_moPFwOCIEeakJtU5f6kHGA" name="PASS" visibility="private" isLeaf="true" isStatic="true" type="_mmeyQOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_moQ68OCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>&quot;&quot;</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_moUlUOCIEeakJtU5f6kHGA" name="singleton" visibility="private" isStatic="true" type="_moRiAOCIEeakJtU5f6kHGA" isUnique="false"/>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_modvQOCIEeakJtU5f6kHGA" name="getConnection" specification="_moar8OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (singleton == null) {&#xD;
        String url, user, pass;&#xD;
        if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Production) {&#xD;
            url = &quot;jdbc:google:mysql://it-projekt-hdm:it-projekt-huber-sql/notizbuch&quot;;&#xD;
            user = &quot;root&quot;;&#xD;
            pass = &quot;nm9000!&quot;;&#xD;
            Class.forName(&quot;com.mysql.jdbc.GoogleDriver&quot;);&#xD;
        } else {&#xD;
            url = DB_URL;&#xD;
            user = USER;&#xD;
            pass = PASS;&#xD;
        }&#xD;
        singleton = DriverManager.getConnection(url, user, pass);&#xD;
    }&#xD;
    return singleton;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_moj14OCIEeakJtU5f6kHGA" name="finalize" specification="_moe9YOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    singleton.close();&#xD;
    super.finalize();&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_moVzcOCIEeakJtU5f6kHGA" name="DBConnection" visibility="protected"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_moar8OCIEeakJtU5f6kHGA" name="getConnection" visibility="public" isStatic="true" method="_modvQOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _mkE-g-CIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mob6EOCIEeakJtU5f6kHGA" type="_moRiAOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_moe9YOCIEeakJtU5f6kHGA" name="finalize" visibility="protected" method="_moj14OCIEeakJtU5f6kHGA" raisedException="_mofkcOCIEeakJtU5f6kHGA"/>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mpPLUOCIEeakJtU5f6kHGA" name="NoteMapper" visibility="public">
                    <generalization xmi:type="uml:Generalization" xmi:id="_mpPyYOCIEeakJtU5f6kHGA" general="_mgwkweCIEeakJtU5f6kHGA"/>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mpV5AOCIEeakJtU5f6kHGA" name="noteMapper" visibility="private" isStatic="true" type="_mpPLUOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mpZjYOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>null</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mpb_oOCIEeakJtU5f6kHGA" name="noteUserMapper" visibility="private" type="_mlxnoOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mpfqAOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>UserInfoMapper.getUserInfoMapper()</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mphfMOCIEeakJtU5f6kHGA" name="noteBookMapper" visibility="private" type="_mgwkwOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mpj7cOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>NoteBookMapper.getNoteBookMapper()</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mpqpIOCIEeakJtU5f6kHGA" name="NoteMapper" specification="_mplwoOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mptFYOCIEeakJtU5f6kHGA" name="getNoteMapper" specification="_mprQMOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (noteMapper == null) {&#xD;
        try {&#xD;
            noteMapper = new NoteMapper();&#xD;
        } catch (ClassNotFoundException e) {&#xD;
            e.printStackTrace();&#xD;
        } catch (SQLException e) {&#xD;
            e.printStackTrace();&#xD;
        }&#xD;
    }&#xD;
    return noteMapper;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mp1oQOCIEeakJtU5f6kHGA" name="create" specification="_mpxW0OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;INSERT INTO notizbuch.note&quot; + &quot;(title, subtitle, content, note_source, creation_date, due_date, modification_date, notebook_id, author_id) VALUES (?,?,?,?,?,?,?,?,?)&quot;, Statement.RETURN_GENERATED_KEYS);&#xD;
        stmt.setString(1, note.getTitle());&#xD;
        stmt.setString(2, note.getSubtitle());&#xD;
        stmt.setString(3, note.getContent());&#xD;
        if (!(note.getSource() == null)) {&#xD;
            stmt.setString(4, note.getSource());&#xD;
        } else {&#xD;
            stmt.setString(4, null);&#xD;
        }&#xD;
        stmt.setDate(5, note.getCreationDate());&#xD;
        stmt.setDate(6, note.getDueDate());&#xD;
        stmt.setDate(7, note.getModificationDate());&#xD;
        if (!(note.getNoteBook() == null)) {&#xD;
            int noteBookId = note.getNoteBook().getId();&#xD;
            stmt.setInt(8, noteBookId);&#xD;
        } else {&#xD;
            stmt.setNull(8, 0);&#xD;
        }&#xD;
        stmt.setInt(9, note.getOwner().getId());&#xD;
        stmt.executeUpdate();&#xD;
        ResultSet rs = stmt.getGeneratedKeys();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getInt(1));&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
    return note;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mp6gwOCIEeakJtU5f6kHGA" name="findById" specification="_mp22YOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (isObjectLoaded(id, Note.class)) {&#xD;
        return (Note) loadedObjects.get(id);&#xD;
    }&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;SELECT * FROM notizbuch.note WHERE id = ?&quot;);&#xD;
        stmt.setInt(1, id);&#xD;
        ResultSet rs = stmt.executeQuery();&#xD;
        if (rs.next()) {&#xD;
            Note note = new Note(rs.getInt(&quot;id&quot;), rs.getString(&quot;content&quot;), rs.getString(&quot;title&quot;), rs.getString(&quot;subtitle&quot;), UserInfoMapper.getUserInfoMapper().findById(rs.getInt(&quot;author_id&quot;)), NoteBookMapper.getNoteBookMapper().findById(rs.getInt(&quot;notebook_id&quot;)), rs.getDate(&quot;creation_date&quot;), rs.getDate(&quot;due_date&quot;), rs.getDate(&quot;modification_date&quot;));&#xD;
            loadedObjects.put(rs.getInt(&quot;id&quot;), note);&#xD;
            return note;&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqAnYOCIEeakJtU5f6kHGA" name="save" specification="_mp8V8OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;UPDATE notizbuch.note SET title=?, subtitle=?, content=?, note_source=?, creation_date=?, due_date=?, modification_date=?, notebook_id=?, author_id=? WHERE id = ?&quot;);&#xD;
        // Alle String-Inhalte&#xD;
        stmt.setString(1, note.getTitle());&#xD;
        stmt.setString(2, note.getSubtitle());&#xD;
        stmt.setString(3, note.getContent());&#xD;
        stmt.setString(4, &quot;Platzhalter Source&quot;);&#xD;
        // Daten&#xD;
        stmt.setDate(5, note.getCreationDate());&#xD;
        stmt.setDate(6, note.getDueDate());&#xD;
        stmt.setDate(7, new Date(System.currentTimeMillis()));&#xD;
        // IDs, gesonderte Nullbehandlung&#xD;
        if (note.getNoteBook() == null) {&#xD;
            stmt.setObject(8, null);&#xD;
        } else {&#xD;
            stmt.setInt(8, note.getNoteBook().getId());&#xD;
        }&#xD;
        stmt.setInt(9, note.getOwner().getId());&#xD;
        // Id der zu speichernden Notiz&#xD;
        stmt.setInt(10, note.getId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        throw new IllegalArgumentException();&#xD;
    }&#xD;
    return findById(note.getId());&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqE40OCIEeakJtU5f6kHGA" name="delete" specification="_mqCckOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;DELETE FROM notizbuch.note WHERE id = ?&quot;);&#xD;
        stmt.setInt(1, note.getId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
        throw new IllegalArgumentException();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqIjMOCIEeakJtU5f6kHGA" name="getAllNotes" specification="_mqGG8OCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        Statement stmt = connection.createStatement();&#xD;
        ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM notizbuch.note&quot;);&#xD;
        return makeNotesFromResultSet(rs);&#xD;
    } catch (SQLException e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return new Vector&lt;Note>();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqfvkOCIEeakJtU5f6kHGA" name="getAllNotesForUserId" specification="_mqbeIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;SELECT * FROM notizbuch.note WHERE author_id = ?&quot;);&#xD;
        stmt.setInt(1, userId);&#xD;
        ResultSet rs = stmt.executeQuery();&#xD;
        return makeNotesFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return new Vector&lt;Note>();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqnEUOCIEeakJtU5f6kHGA" name="getAllNotesForUser" specification="_mqg9sOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement stmt = connection.prepareStatement(&quot;SELECT * FROM notizbuch.note WHERE author_id = ? AND due_date >=NOW() ORDER BY due_date LIMIT 5&quot;);&#xD;
        stmt.setInt(1, userId);&#xD;
        ResultSet rs = stmt.executeQuery();&#xD;
        return makeNotesFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return new Vector&lt;Note>();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqoSceCIEeakJtU5f6kHGA" name="getAllNotesForNoteBookId" specification="_mqnrYOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(&quot;SELECT * FROM notizbuch.note WHERE notebook_id = ?&quot;);&#xD;
        ps.setInt(1, id);&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        return makeNotesFromResultSet(rs);&#xD;
    } catch (SQLExceptionClassNotFoundException |  e) {&#xD;
        e.printStackTrace();&#xD;
    }&#xD;
    return new Vector&lt;>();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqpgkeCIEeakJtU5f6kHGA" name="getAllNotesSharedWith" specification="_mqo5gOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    try {&#xD;
        String sql = &quot;SELECT note.id AS id, title, subtitle, content, note_source, creation_date, due_date, modification_date, note.notebook_id AS notebook_id, note.author_id AS author_id FROM note &quot; + &quot;JOIN permission ON note.id = permission.note_id WHERE beneficiary_id = ?&quot;;&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, u.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        return makeNotesFromResultSet(rs);&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
        return new Vector&lt;>();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqquseCIEeakJtU5f6kHGA" name="makeNotesFromResultSet" specification="_mqqHoOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;Note> v = new Vector&lt;>();&#xD;
    while (rs.next()) {&#xD;
        Note note = new Note(rs.getInt(&quot;id&quot;));&#xD;
        note.setContent(rs.getString(&quot;content&quot;));&#xD;
        note.setTitle(rs.getString(&quot;title&quot;));&#xD;
        note.setSubtitle(rs.getString(&quot;subtitle&quot;));&#xD;
        note.setOwner(noteUserMapper.findById(rs.getInt(&quot;author_id&quot;)));&#xD;
        note.setNoteBook(noteBookMapper.findById(rs.getInt(&quot;notebook_id&quot;)));&#xD;
        note.setCreationDate(rs.getDate(&quot;creation_date&quot;));&#xD;
        note.setDueDate(rs.getDate(&quot;due_date&quot;));&#xD;
        note.setModificationDate(rs.getDate(&quot;modification_date&quot;));&#xD;
        v.add(note);&#xD;
    }&#xD;
    return v;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mqr80eCIEeakJtU5f6kHGA" name="getAllNotesSharedBy" specification="_mqrVwOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    String sql = &quot;SELECT DISTINCT note.id AS id FROM note JOIN permission ON note.id = permission.note_id WHERE note.author_id = ?&quot;;&#xD;
    Vector&lt;Note> v = new Vector&lt;>();&#xD;
    try {&#xD;
        PreparedStatement ps = connection.prepareStatement(sql);&#xD;
        ps.setInt(1, u.getId());&#xD;
        ResultSet rs = ps.executeQuery();&#xD;
        while (rs.next()) {&#xD;
            v.add(findById(rs.getInt(&quot;id&quot;)));&#xD;
        }&#xD;
        return v;&#xD;
    } catch (Exception e) {&#xD;
        e.printStackTrace();&#xD;
        return v;&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mplwoOCIEeakJtU5f6kHGA" name="NoteMapper" visibility="protected" method="_mpqpIOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mprQMOCIEeakJtU5f6kHGA" name="getNoteMapper" visibility="public" isStatic="true" method="_mptFYOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mpr3QOCIEeakJtU5f6kHGA" type="_mpPLUOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mpxW0OCIEeakJtU5f6kHGA" name="create" visibility="public" method="_mp1oQOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mpyk8OCIEeakJtU5f6kHGA" type="_mpuTgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mpzzEOCIEeakJtU5f6kHGA" name="note" type="_mpuTgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mp22YOCIEeakJtU5f6kHGA" name="findById" visibility="public" method="_mp6gwOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mp4EgOCIEeakJtU5f6kHGA" type="_mpuTgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mp4rkOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mp8V8OCIEeakJtU5f6kHGA" name="save" visibility="public" method="_mqAnYOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mp9kEOCIEeakJtU5f6kHGA" type="_mpuTgOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mp-yMOCIEeakJtU5f6kHGA" name="note" type="_mpuTgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqCckOCIEeakJtU5f6kHGA" name="delete" visibility="public" method="_mqE40OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqDqsOCIEeakJtU5f6kHGA" name="note" type="_mpuTgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqGG8OCIEeakJtU5f6kHGA" name="getAllNotes" visibility="public" method="_mqIjMOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqHVEOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqbeIOCIEeakJtU5f6kHGA" name="getAllNotesForUserId" visibility="public" method="_mqfvkOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqdTUOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqfIgOCIEeakJtU5f6kHGA" name="userId">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqg9sOCIEeakJtU5f6kHGA" name="getAllNotesForUser" visibility="public" method="_mqnEUOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqjZ8OCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mql2MOCIEeakJtU5f6kHGA" name="userId">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqnrYOCIEeakJtU5f6kHGA" name="getAllNotesForNoteBookId" visibility="public" method="_mqoSceCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqnrYeCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqoScOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_7wRIABydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqo5gOCIEeakJtU5f6kHGA" name="getAllNotesSharedWith" visibility="public" method="_mqpgkeCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqo5geCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqpgkOCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqqHoOCIEeakJtU5f6kHGA" name="makeNotesFromResultSet" visibility="private" method="_mqquseCIEeakJtU5f6kHGA" raisedException="_ml6KgOCIEeakJtU5f6kHGA _mkB7MOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqqHoeCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqqusOCIEeakJtU5f6kHGA" name="rs" type="_mnb0gOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mqrVwOCIEeakJtU5f6kHGA" name="getAllNotesSharedBy" visibility="public" method="_mqr80eCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqrVweCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mqr80OCIEeakJtU5f6kHGA" name="u" type="_mlTGgOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                  </packagedElement>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mqw1UOCIEeakJtU5f6kHGA" name="SourceMapper" visibility="public">
                    <generalization xmi:type="uml:Generalization" xmi:id="_mqw1UeCIEeakJtU5f6kHGA" general="_mgwkweCIEeakJtU5f6kHGA"/>
                    <ownedAttribute xmi:type="uml:Property" xmi:id="_mqyDcOCIEeakJtU5f6kHGA" name="sourceMapper" visibility="private" isStatic="true" type="_mqw1UOCIEeakJtU5f6kHGA" isUnique="false">
                      <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_mq3jAOCIEeakJtU5f6kHGA" name="defaultValue">
                        <language>JAVA</language>
                        <body>null</body>
                      </defaultValue>
                    </ownedAttribute>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mq9CkOCIEeakJtU5f6kHGA" name="SourceMapper" specification="_mq4xIOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    super();&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrB7EOCIEeakJtU5f6kHGA" name="getSourceMapper" specification="_mq-3wOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    if (sourceMapper == null) {&#xD;
        sourceMapper = new SourceMapper();&#xD;
    }&#xD;
    return sourceMapper;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrJ24OCIEeakJtU5f6kHGA" name="create" specification="_mrGMgOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;INSERT INTO source(Url)&quot; + &quot;VALUES (?)&quot;, Statement.RETURN_GENERATED_KEYS);&#xD;
        stmt.setString(1, source.getURL().toString());&#xD;
        stmt.executeUpdate();&#xD;
        ResultSet rs = stmt.getGeneratedKeys();&#xD;
        if (rs.next()) {&#xD;
            return findById(rs.getInt(1));&#xD;
        // else {&#xD;
        }&#xD;
    // throw new SQLException(&quot;Sorry&quot;);&#xD;
    // }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
    return source;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrQkkOCIEeakJtU5f6kHGA" name="findById" specification="_mrLFAOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;SELECT Source FROM Notebook.Note WHERE Id = ?&quot;);&#xD;
        stmt.setLong(1, id);&#xD;
        // Ergebnis holen&#xD;
        ResultSet results = stmt.executeQuery();&#xD;
        if (results.next()) {&#xD;
            // new Source(results.getURL(&quot;URL&quot;));&#xD;
            return null;&#xD;
        }&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
        return null;&#xD;
    }&#xD;
    return null;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrVdEOCIEeakJtU5f6kHGA" name="save" specification="_mrSZwOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;UPDATE Source SET url=? WHERE urlId=?&quot;);&#xD;
        stmt.setString(1, source.getURL().toString());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
    // aktualisierte Berechtigung zur?ckgeben&#xD;
    return source;&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrZugOCIEeakJtU5f6kHGA" name="delete" specification="_mrWrMOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    try {&#xD;
        PreparedStatement stmt = con.prepareStatement(&quot;DELETE FROM Source WHERE Id=?&quot;);&#xD;
        stmt.setLong(1, source.getSourceId());&#xD;
        stmt.executeUpdate();&#xD;
    } catch (SQLException sqlExp) {&#xD;
        sqlExp.printStackTrace();&#xD;
    }&#xD;
</body>
                    </ownedBehavior>
                    <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_mrhDQOCIEeakJtU5f6kHGA" name="getAllSource" specification="_mra8oOCIEeakJtU5f6kHGA">
                      <language>JAVA</language>
                      <body>&#xD;
    Vector&lt;Source> result = new Vector&lt;Source>();&#xD;
    Connection con = DBConnection.getConnection();&#xD;
    PreparedStatement stmt = con.prepareStatement(&quot;SELECT Id FROM Source&quot;);&#xD;
    ResultSet rs = stmt.executeQuery();&#xD;
    while (rs.next()) {&#xD;
        result.add(this.findById(rs.getLong(&quot;Id&quot;)));&#xD;
    }&#xD;
    return result;&#xD;
</body>
                    </ownedBehavior>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mq4xIOCIEeakJtU5f6kHGA" name="SourceMapper" visibility="protected" method="_mq9CkOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA"/>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mq-3wOCIEeakJtU5f6kHGA" name="getSourceMapper" visibility="public" isStatic="true" method="_mrB7EOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrAF4OCIEeakJtU5f6kHGA" type="_mqw1UOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mrGMgOCIEeakJtU5f6kHGA" name="create" visibility="public" method="_mrJ24OCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrGzkOCIEeakJtU5f6kHGA" type="_mrDJMOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrIBsOCIEeakJtU5f6kHGA" name="source" type="_mrDJMOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mrLFAOCIEeakJtU5f6kHGA" name="findById" visibility="public" method="_mrQkkOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrLsEOCIEeakJtU5f6kHGA" type="_mrDJMOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrM6MOCIEeakJtU5f6kHGA" name="id">
                        <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusJava_LIBRARIES/JavaLibrary.uml#_8heigBydEduyofBvg4RL2w"/>
                      </ownedParameter>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mrSZwOCIEeakJtU5f6kHGA" name="save" visibility="public" method="_mrVdEOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrTA0OCIEeakJtU5f6kHGA" type="_mrDJMOCIEeakJtU5f6kHGA" direction="return"/>
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrUO8OCIEeakJtU5f6kHGA" name="source" type="_mrDJMOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mrWrMOCIEeakJtU5f6kHGA" name="delete" visibility="public" method="_mrZugOCIEeakJtU5f6kHGA" raisedException="_mkB7MOCIEeakJtU5f6kHGA _ml6KgOCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrX5UOCIEeakJtU5f6kHGA" name="source" type="_mrDJMOCIEeakJtU5f6kHGA"/>
                    </ownedOperation>
                    <ownedOperation xmi:type="uml:Operation" xmi:id="_mra8oOCIEeakJtU5f6kHGA" name="getAllSource" visibility="public" method="_mrhDQOCIEeakJtU5f6kHGA" raisedException="_mrcx0OCIEeakJtU5f6kHGA">
                      <ownedParameter xmi:type="uml:Parameter" xmi:id="_mrbjsOCIEeakJtU5f6kHGA" type="_mlIucOCIEeakJtU5f6kHGA" direction="return"/>
                    </ownedOperation>
                  </packagedElement>
                </packagedElement>
              </packagedElement>
            </packagedElement>
          </packagedElement>
        </packagedElement>
      </packagedElement>
    </packagedElement>
    <packagedElement xmi:type="uml:Package" xmi:id="_mkE-gOCIEeakJtU5f6kHGA" name="java">
      <packagedElement xmi:type="uml:Package" xmi:id="_mkE-geCIEeakJtU5f6kHGA" name="java">
        <packagedElement xmi:type="uml:Package" xmi:id="_mkE-guCIEeakJtU5f6kHGA" name="sql">
          <packagedElement xmi:type="uml:Class" xmi:id="_mkE-g-CIEeakJtU5f6kHGA" name="SQLException"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_mlcQcOCIEeakJtU5f6kHGA" name="ResultSet"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_moRiAOCIEeakJtU5f6kHGA" name="Connection"/>
        </packagedElement>
        <packagedElement xmi:type="uml:Package" xmi:id="_mlHgUOCIEeakJtU5f6kHGA" name="util">
          <packagedElement xmi:type="uml:Class" xmi:id="_mlIucOCIEeakJtU5f6kHGA" name="Vector"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_mooHUOCIEeakJtU5f6kHGA" name="Map"/>
        </packagedElement>
        <packagedElement xmi:type="uml:Package" xmi:id="_mmeLMOCIEeakJtU5f6kHGA" name="lang">
          <packagedElement xmi:type="uml:Class" xmi:id="_mmeyQOCIEeakJtU5f6kHGA" name="String"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_mofkcOCIEeakJtU5f6kHGA" name="Throwable"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_mo2JwOCIEeakJtU5f6kHGA" name="Class"/>
          <packagedElement xmi:type="uml:Class" xmi:id="_mrcx0OCIEeakJtU5f6kHGA" name="Exception"/>
        </packagedElement>
      </packagedElement>
    </packagedElement>
    <packagedElement xmi:type="uml:Package" xmi:id="_mkIB0OCIEeakJtU5f6kHGA" name="importedTypes">
      <packagedElement xmi:type="uml:Package" xmi:id="_mkIB0eCIEeakJtU5f6kHGA" name="de">
        <packagedElement xmi:type="uml:Package" xmi:id="_mkIB0uCIEeakJtU5f6kHGA" name="hdm_stuttgart">
          <packagedElement xmi:type="uml:Package" xmi:id="_mkIB0-CIEeakJtU5f6kHGA" name="huber">
            <packagedElement xmi:type="uml:Package" xmi:id="_mkIB1OCIEeakJtU5f6kHGA" name="itprojekt">
              <packagedElement xmi:type="uml:Package" xmi:id="_mkIB1eCIEeakJtU5f6kHGA" name="shared">
                <packagedElement xmi:type="uml:Package" xmi:id="_mkIo4OCIEeakJtU5f6kHGA" name="domainobjects">
                  <packagedElement xmi:type="uml:Class" xmi:id="_mkIo4eCIEeakJtU5f6kHGA" name="NoteBook"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mlTGgOCIEeakJtU5f6kHGA" name="UserInfo"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mnJgoOCIEeakJtU5f6kHGA" name="Shareable"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mnNLAOCIEeakJtU5f6kHGA" name="Permission"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mpuTgOCIEeakJtU5f6kHGA" name="Note"/>
                  <packagedElement xmi:type="uml:Class" xmi:id="_mrDJMOCIEeakJtU5f6kHGA" name="Source"/>
                </packagedElement>
              </packagedElement>
            </packagedElement>
          </packagedElement>
        </packagedElement>
      </packagedElement>
    </packagedElement>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_mgVG8OCIEeakJtU5f6kHGA">
      <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_mgVG8eCIEeakJtU5f6kHGA" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/PapyrusJava/1#/"/>
      </eAnnotations>
      <appliedProfile xmi:type="uml:Profile" href="pathmap://PapyrusJava_PROFILES/PapyrusJava.profile.uml#_j9REUByGEduN1bTiWJ0lyw"/>
    </profileApplication>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_mgffAOCIEeakJtU5f6kHGA">
      <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_mgffAeCIEeakJtU5f6kHGA" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/Codegen/1#/"/>
      </eAnnotations>
      <appliedProfile xmi:type="uml:Profile" href="pathmap://Codegen_PROFILES/Codegen.profile.uml#_fPDsIBa-EearhdjjJ6cVzQ"/>
    </profileApplication>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_mgpQAOCIEeakJtU5f6kHGA">
      <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_mgpQAeCIEeakJtU5f6kHGA" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
      </eAnnotations>
      <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
    </profileApplication>
  </uml:Model>
  <PapyrusJava:External xmi:id="_mkDwYOCIEeakJtU5f6kHGA" name="ClassNotFoundException" base_Classifier="_mkB7MOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mkGzsOCIEeakJtU5f6kHGA" name="java.sql.SQLException" base_Classifier="_mkE-g-CIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mkJ3AOCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.NoteBook" base_Classifier="_mkIo4eCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mlLKsOCIEeakJtU5f6kHGA" name="java.util.Vector" base_Classifier="_mlIucOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mlViwOCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.UserInfo" base_Classifier="_mlTGgOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mleFoOCIEeakJtU5f6kHGA" name="java.sql.ResultSet" base_Classifier="_mlcQcOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_ml8mwOCIEeakJtU5f6kHGA" name="SQLException" base_Classifier="_ml6KgOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mmhOgOCIEeakJtU5f6kHGA" name="java.lang.String" base_Classifier="_mmeyQOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mnLV0OCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.Shareable" base_Classifier="_mnJgoOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mnPAMOCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.Permission" base_Classifier="_mnNLAOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mndpsOCIEeakJtU5f6kHGA" name="ResultSet" base_Classifier="_mnb0gOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_moT-QOCIEeakJtU5f6kHGA" name="java.sql.Connection" base_Classifier="_moRiAOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_moiAsOCIEeakJtU5f6kHGA" name="java.lang.Throwable" base_Classifier="_mofkcOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_moqjkOCIEeakJtU5f6kHGA" name="java.util.Map" base_Classifier="_mooHUOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mo3-8OCIEeakJtU5f6kHGA" name="java.lang.Class" base_Classifier="_mo2JwOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mpwvwOCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.Note" base_Classifier="_mpuTgOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mrE-YOCIEeakJtU5f6kHGA" name="de.hdm_stuttgart.huber.itprojekt.shared.domainobjects.Source" base_Classifier="_mrDJMOCIEeakJtU5f6kHGA"/>
  <PapyrusJava:External xmi:id="_mrfOEOCIEeakJtU5f6kHGA" name="java.lang.Exception" base_Classifier="_mrcx0OCIEeakJtU5f6kHGA"/>
</xmi:XMI>
