- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요. 선생님 하이오더 컴포넌트가 CreateListView.js이잖아요. 이걸 쓰는 이유가 중복되는 코드의 재사용이라고 하셨는데요. NewsView, JobsView, AskView에서 List로 뿌려주는 부분이 공통적이기 ListView.vue라는 공통 컴포넌트를 만들어 줬잖아요. 그렇다면 데이터를 불러오는 부분이 공통적이면 ListView.vue처럼 공통적인 소스코드를 넣을 컴포넌트를 만들면 되지 않나요? js파일이라는 하이오더 컴포넌트랑 공통부분을 따로 뺀 vue 파일이랑 어떤 부분이 차이점이 있는지 잘 이해가 되지 않습니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 선생님 안녕하세요. 질문이 두가지 있습니다. bus.$emit('start:spinner'); 에서 start: spinner는 무슨 구조인가요? 예를들어 객체: 메소드 뭐 이런것처럼 앞에 : 뒤에 각각 뭐를 써줘야 하는건가요? 그리고 여기서의 이벤트 버스는 스피너라는 이벤트를 NewsView, jobsView, askView에서 호출하고 그걸 App.vue에서 받아서 화면에 보여주는 거잖아요. vue.js가 모든 컴포넌트들을 app.vue에 최종적으로 모아서 하나의 페이지로 보여주는 SPA이니.. 항상 이벤트 버스의 이벤트를 받는건 APP.VUE가 되는건가요?
스프링부트에서 이미지 경로를 file:path:/var/lib/photo 로 설정한 뒤에 compose 에서 볼륨 옵션으로 ./photo:/var/lib/photo 이렇게 설정을 했습니다. 근데 이미지파일을 업로드 해도 화면상에서는 잘 보이는데 exec bash 명령어로 해당 폴더에 들어가보아도 .png 파일이 보이지 않습니다. ㅠㅠㅠㅠㅠ 이런 경우 파일업로드 경로를 다르게 해주어야하나요??
안녕하세요. 항상 강의 잘듣고있는 학생입니다. 스프링 시큐리티보단 스프링 프레임워크 질문쪽에 조금 더 가까울 것같아 미리 양해드립니다. 이 부분에서 userDetailsService 를 상속받는데 CustomUserDetailsService 클래스의 빈네임을 @Service("userDetailService")로 따로 지정하지 않고 @Service 만 선언해주어도 따로 에러가 나지 않는 것으로 보여지는데, 왜 이런 부분이 가능한지가 궁금합니다. 또 추후 문제가 발생할 여지가 있는지도 궁금합니다. 항상 좋은 강의 감사합니다.
안녕하세요. 강의 56초 부분 문의 드립니다. 각 쓰레드가 다른 instance를 가지게 된다고 설명해 주셨는데요. 직관적으로 이해하면 이 때의 instance는 지역변수가 아니므로 힙 메모리를 참조하고 있으니 뒤에 오는 쓰레드가 instance에 값을 덮어쓸 것 같습니다. 메모리가 아닌 캐시를 참조한다고 해도 각 쓰레드가 같은 캐시를 참조할 수 있을 것 같아요. 혹시 이 경우에 각 쓰레드가 다른 instance를 각각 가지게 되는 이유가 무엇인지 궁금합니다..!
안녕하세요. 강의를 따라하던 중 UI_Button.cs에서 Bind함수의 for문 안에 Util을 넣는 순간(?) 유니티에서 아래와 같은 오류가 떴습니다. 강의를 다시 보며 확인해봤지만 어느부분에서 틀린건지 찾지 못해서 도움을 요청합니다...ㅜㅠ UI_Button.cs 코드입니다 using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UI_Button : MonoBehaviour { Dictionary<Type, UnityEngine.Object[]> _objects = new Dictionary<Type, UnityEngine.Object[]>(); enum Buttons { PointButton } enum Texts { PointText, ScoreText } private void Start() { Bind<Button>(typeof(Buttons)); Bind<Text>(typeof(Texts)); } void Bind<T>(Type type) where T : UnityEngine.Object { string[] names = Enum.GetNames(type); UnityEngine.Object[] objects = new UnityEngine.Object[names.Length]; _objects.Add(typeof(T), objects); for (int i = 0; i < names.Length; i++) { objects[i] = Util.FindChild<T>(gameObject, names[i], true); } } int _score = 0; public void OnButtonClicked() { _score++; } } Util.cs 코드 입니다 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Util { public static T FindChild<T>(GameObject go, string name = null, bool recursive = false) where T : UnityEngine.Object { if (go == null) return null; if(recursive == false) { for (int i = 0; i < go.transform.childCount; i++) { Transform transform = go.transform.GetChild(i); if (string.IsNullOrEmpty(name) || transform.name == name) { T component = transform.GetComponent<T>(); if (component != null) return component; } } } else { foreach(T component in go.GetComponentsInChildren<T>()) { if (string.IsNullOrEmpty(name) || component.name == name) return component; } } return null; } }
회원가입 테스트 시에 다음과 같은 오류가 나왔습니다. org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: m near line 1, column 8 [select m from New.Project.domain.Member m where m.name = :name]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: m near line 1, column 8 [select m from New.Project.domain.Member m where m.name = :name] at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:374) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) at New.Project.repository.MemberRepository$$EnhancerBySpringCGLIB$$454820b5.findByName(<generated>) at New.Project.service.MemberService.validateDuplicateMember(MemberService.java:32) at New.Project.service.MemberService.join(MemberService.java:23) at New.Project.service.MemberService$$FastClassBySpringCGLIB$$f645c5ff.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) at New.Project.service.MemberService$$EnhancerBySpringCGLIB$$fe666e5a.join(<generated>) at New.Project.service.MemberServiceTest.회원가입(MemberServiceTest.java:30) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Suppressed: org.springframework.transaction.UnexpectedRollbackException: Transaction silently rolled back because it has been marked as rollback-only at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:752) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:131) at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:255) at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:445) at org.springframework.test.context.junit.jupiter.SpringExtension.afterEach(SpringExtension.java:206) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachCallbacks$11(TestMethodTestDescriptor.java:253) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$12(TestMethodTestDescriptor.java:269) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:269) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:268) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachCallbacks(TestMethodTestDescriptor.java:252) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137) ... 43 more Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: m near line 1, column 8 [select m from New.Project.domain.Member m where m.name = :name] at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:734) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:825) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:114) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:311) at jdk.proxy2/jdk.proxy2.$Proxy106.createQuery(Unknown Source) at New.Project.repository.MemberRepository.findByName(MemberRepository.java:32) at New.Project.repository.MemberRepository$$FastClassBySpringCGLIB$$80b35ce5.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ... 84 more Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: m near line 1, column 8 [select m from New.Project.domain.Member m where m.name = :name] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) at org.hibernate.hql.internal.ast.ErrorTracker.throwQueryException(ErrorTracker.java:93) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:301) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:113) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:73) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:162) at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:613) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:725) ... 99 more 제가 이것저것 해보았을 때, MemberService의 join에서 validateDuplicateMember(member) 를 지웠을 때는 원만히 돌아가서 이 부분이 문제인 것 같다고 추측을 했는데 어떤 부분이 문제인지는 모르겠습니다. 다음은 Member, MemberRepository, MemberService, MemberServiceTest 코드입니다. package New.Project.repository; import New.Project.domain.Member; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.List; @Repository @RequiredArgsConstructor public class MemberRepository { private final EntityManager em; public void save(Member member) { em.persist(member); } public Member findOne(Long id) { return em.find(Member.class, id); } public List<Member> findAll() { return em.createQuery("select m from Member m", Member.class) .getResultList(); } public List<Member> findByName(String name) { return em.createQuery("select m from Member m where m.name = :name", Member.class) .setParameter("name", name) .getResultList(); } } package New.Project.service; import New.Project.domain.Member; import New.Project.repository.MemberRepository; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional(readOnly = true) @RequiredArgsConstructor public class MemberService { private final MemberRepository memberRepository; // 회원 가입 @Transactional public Long join(Member member) { validateDuplicateMember(member); // 중복 회원 검증 memberRepository.save(member); return member.getId(); } private void validateDuplicateMember(Member member) { // EXCEPTION List<Member> findMembers = memberRepository.findByName(member.getName()); if (!findMembers.isEmpty()) { throw new IllegalStateException("이미 존재하는 회원입니다."); } } // 회원 전체 조회 public List<Member> findMembers() { return memberRepository.findAll(); } public Member findOne(Long memberId) { return memberRepository.findOne(memberId); } } package New.Project.service; import New.Project.domain.Member; import New.Project.repository.MemberRepository; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.transaction.annotation.Transactional; import static org.junit.jupiter.api.Assertions.*; @SpringBootTest @Transactional class MemberServiceTest { @Autowired private MemberService memberService; @Autowired private MemberRepository memberRepository; @Test @Rollback(false) public void 회원가입() throws Exception { //given Member member = new Member(); member.setName("lee"); //when Long savedId = memberService.join(member); //then assertEquals(member, memberRepository.findOne(savedId)); } @Test public void 중복_회원_예약() throws Exception { } } package New.Project.domain; import lombok.Getter; import lombok.Setter; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Getter @Setter public class Member { @Id @GeneratedValue @Column(name = "member_id") private Long id; private String name; @Embedded private Address address; @OneToMany(mappedBy = "member") private List<Order> orders = new ArrayList<>(); }
카메라에 접근할 때는 plist에 설정한 메세지가 alert을 통해 나오는데, 포토라이브러리에 접근할때는 나타나지 않습니다. 앱을 삭제하고 사진첩에 먼저 접근해보아도 별다른 허용 절차없이 바로 접근이 되는데 이래도 되는건가요..? ------추가 질문) 교재 681(mailComposeController - dismiss)과 똑같이 코드를 작성했는데요, dismiss코드가 메일 전송 버튼을 눌렀을때 실행돼야하는것 같은데 키보드만 내려가고 dismiss 되지 않습니다. (답변항상 감사드립니다!)
안녕하세요 이번 강의 완강하고 내용 복습하면서 개인적으로 연습하고 있었습니다. 저희가 entity에서 manytoone 으로 user와 board를 연결시켜 주었잖아요 그리고 user랑 board둘 중 한군데는 "eager : true" 를 안해야지 오류가 안뜨더라고요 그래서 일단 user는 eager 설정은 안했습니다 그런데 프론트에서 user가 쓴 board 리스트를 불러와야 할 때 가 있는데 (내가쓴 게시글 목록 불러오기) user.board 하니 아무것도 안뜨더라고요... (board.user 은잘뜹니다) user 에서 해당 user를 가지고있는 board를 불러올 방법이 있나요? 아니면 controller에서 따로 만들어야 하나요?