CNU_SW_모각코

17주차 모각코 학습 결과(22.10.27 13:00 ~ 16:00)

nayeonee__ 2022. 10. 31. 19:39

 

• Multivalued Attributes : 여러 개의 값을 갖는 속성

• Single-valued Attributes : 항상 하나의 값만을 갖는 속성

• Composite Attributes : 둘 이상으로 여러가지로 나뉘어도 여전히 의미를 갖 는 속성

⇒ 어떤 속성을 과연 쪼개도 되는지 안되는지는 설계자가 판단을 해야한 .

ex ) 어떤속성을 안쪼갰더니 왜 안쪼갰어 ? 우리는 쪼개서 쓰는 일이 없고 하나로 하는게 편해 ⇒ 쪼갤 필요가 없이 simple 있으면 OK. 

우리는 나눠서 사용하는 경우 많아서 나눠서 저장하는게 좋아 ⇒ simple simple 나눠서 사용

• 키속성특징:유일성,최소성 • conceptional : Identifier

• Entity : 부서, 직원, 프로젝트명, 부양가족

• logical : primary key Identifier 을 가지고 primary key 만들게 된다.

→회사는 엔티티가 될 수 없음 : 여러 개의 회사를 비교하는 것이 아니고 개의 회사이기 때문 

Entity Relationship Attribute

 

 

+ 카공 프로젝트 일부 코드

 

<span sec:authorize="hasAnyAuthority('ROLE_ADMIN')">
<a th:href="@{/admin/question/update/{id}(id=${question.id})}" class="btn btn-warning">
질문수정</a>
<button id="btn-delete" class="btn btn-danger">질문삭제</button>
</span>
<br/> <br/> <div>
</div> <br/>
<span>질문 번호</span>
<span id="id">[[${question.id}]]</span>
<span>|
작성자 질문자 | </span>
<span>등록일</span>
<span
th:text="${#temporals.format(question.createdAt, 'yyyy-MM-dd')}"></span>
=,&bc
<div> <h3>[[${question.title}]]</h3>
</div>
<hr/> <div>[[${question.content}]]</div> <br/><br/>
<div class="card"> <form>
<!-- <input th:value="${#authentication.getPrincipal().user.id}"/>-->
type="hidden"
id="userId"
</button>
<input type="hidden" id="questionId" th:value="${question.id}"/> <div class="card-body">
<textarea id="answer-comment" class="form-control" rows="1"></textarea> </div>
<div style="width:100px;float:right;">
<button type="button" id="btn-answer-save" class="btn btn-primary">답변등록
</div> </form>
</div>
<br/>
<div class="card">
<div class="card-header">답변</div> <ul id="answer-box" class="list-group">
<th:block th:each="answer : ${question.answers}"> <li th:id="|answer-${answer.id}|"
justify-content-between> <div>[[${answer.comment}]]</div> <div style="width:100px;float:right;">
<button
sec:authorize="hasAnyAuthority('ROLE_ADMIN')" th:onClick="|main.answerDelete(${question.id}, class="btn btn-primary">답변삭제 </button> </div> </li>
</th:block> </ul>
</div> </div>
<script type="text/javascript" th:src="@{/js/question.js}"></script> </main> </body> </html>