# Doctrine ORM 기초 (Symfony) > Entities, annotations, EntityManager, repositories, DQL, QueryBuilder, relationships - 25 면접 질문 - Junior - [면접 질문: Symfony](https://sharpskill.dev/ko/technologies/symfony/interview-questions.md) ## 1. Symfony 맥락에서 Doctrine ORM이란 무엇입니까? **답변** Doctrine ORM은 PHP 객체를 통해 데이터베이스 데이터를 다룰 수 있게 해주는 Object-Relational Mapper입니다. 객체 계층을 제공하여 SQL 쿼리를 추상화함으로써 코드를 더 유지보수하기 쉽고 다양한 데이터베이스 관리 시스템 간에 이식 가능하게 만듭니다. Symfony에서 권장되는 기본 ORM입니다. ## 2. 클래스를 Doctrine entity로 선언하기 위해 사용해야 하는 PHP 8 attribute는 무엇입니까? **답변** #[ORM\Entity] attribute는 PHP 클래스가 데이터베이스 테이블에 매핑된 entity임을 Doctrine에 알리기 위해 사용됩니다. 이 attribute는 주석 기반 annotations를 대체하며 Doctrine\ORM\Mapping namespace에 속합니다. repositoryClass와 결합하여 사용자 정의 repository를 지정할 수 있습니다. ## 3. Doctrine entity에서 자동 증가하는 컬럼을 primary key로 정의하려면 어떻게 합니까? **답변** 자동 증가하는 primary key를 정의하려면 두 가지 attributes를 결합해야 합니다. 속성을 식별자로 표시하는 #[ORM\Id]와 값이 데이터베이스에 의해 자동으로 생성됨을 나타내는 #[ORM\GeneratedValue]입니다. 기본 전략은 AUTO이며, DBMS에 따라 적절한 방법을 선택합니다. ## 22개 추가 질문 이용 가능 - EntityManager에서 persist()와 flush()의 차이점은 무엇입니까? - Doctrine에서 string 속성을 VARCHAR 컬럼에 매핑하려면 어떤 attribute를 사용해야 합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Symfony 면접 주제 - [모던 PHP (8.1+)](https://sharpskill.dev/ko/technologies/symfony/interview-questions/php-modern-features.md): 20개 질문, Junior - [Symfony 기초](https://sharpskill.dev/ko/technologies/symfony/interview-questions/symfony-basics.md): 25개 질문, Junior - [Routing & Controllers](https://sharpskill.dev/ko/technologies/symfony/interview-questions/routing-controllers.md): 20개 질문, Junior - [Twig & Templates](https://sharpskill.dev/ko/technologies/symfony/interview-questions/twig-templates.md): 20개 질문, Junior - [Symfony 폼](https://sharpskill.dev/ko/technologies/symfony/interview-questions/forms.md): 22개 질문, Junior - [데이터 유효성 검사](https://sharpskill.dev/ko/technologies/symfony/interview-questions/validation.md): 18개 질문, Junior - [Dependency Injection & Services](https://sharpskill.dev/ko/technologies/symfony/interview-questions/dependency-injection.md): 24개 질문, Mid-Level - [Security & Authentication](https://sharpskill.dev/ko/technologies/symfony/interview-questions/security-authentication.md): 26개 질문, Mid-Level - [Doctrine 고급](https://sharpskill.dev/ko/technologies/symfony/interview-questions/doctrine-advanced.md): 24개 질문, Mid-Level - [API Platform](https://sharpskill.dev/ko/technologies/symfony/interview-questions/api-platform.md): 22개 질문, Mid-Level - [Serializer Component](https://sharpskill.dev/ko/technologies/symfony/interview-questions/serializer.md): 20개 질문, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/ko/technologies/symfony/interview-questions/events-subscribers.md): 20개 질문, Mid-Level - [Console & Commands](https://sharpskill.dev/ko/technologies/symfony/interview-questions/console-commands.md): 18개 질문, Mid-Level - [Messenger Component](https://sharpskill.dev/ko/technologies/symfony/interview-questions/messenger.md): 22개 질문, Mid-Level - [HTTP Client](https://sharpskill.dev/ko/technologies/symfony/interview-questions/http-client.md): 18개 질문, Mid-Level - [캐시 및 성능](https://sharpskill.dev/ko/technologies/symfony/interview-questions/cache.md): 20개 질문, Mid-Level - [Workflow Component](https://sharpskill.dev/ko/technologies/symfony/interview-questions/workflow.md): 18개 질문, Mid-Level - [Testing Symfony](https://sharpskill.dev/ko/technologies/symfony/interview-questions/testing.md): 22개 질문, Mid-Level - [Mailer Component](https://sharpskill.dev/ko/technologies/symfony/interview-questions/mailer.md): 16개 질문, Mid-Level - [번역 및 i18n](https://sharpskill.dev/ko/technologies/symfony/interview-questions/translations.md): 16개 질문, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/ko/technologies/symfony/interview-questions/easyadmin.md): 18개 질문, Mid-Level - [Symfony 아키텍처](https://sharpskill.dev/ko/technologies/symfony/interview-questions/architecture-patterns.md): 24개 질문, Senior - [성능 및 최적화](https://sharpskill.dev/ko/technologies/symfony/interview-questions/performance-optimization.md): 22개 질문, Senior - [고급 보안](https://sharpskill.dev/ko/technologies/symfony/interview-questions/security-advanced.md): 22개 질문, Senior - [커스텀 번들](https://sharpskill.dev/ko/technologies/symfony/interview-questions/custom-bundles.md): 20개 질문, Senior - [Symfony를 사용한 마이크로서비스](https://sharpskill.dev/ko/technologies/symfony/interview-questions/microservices.md): 22개 질문, Senior - [Real-time & WebSockets](https://sharpskill.dev/ko/technologies/symfony/interview-questions/real-time.md): 18개 질문, Senior - [Deployment & DevOps](https://sharpskill.dev/ko/technologies/symfony/interview-questions/deployment-devops.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/symfony/interview-questions/doctrine-orm-basics