... Failed! Error: SET PASSWORD has no significance for user 'root'@' localhost ' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters. 구글링도하고 mysql다시깔아서 local password도 다시 설정했는데 자꾸 이 오류가 나오네요.. 혹시 해결 방법이 있을까요?
[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
레스토랑 상세 API (/restaurant/{id}) 호출 시 아래와 같이 헤더값을 넣어 줬을 때 @Headers({ 'accessToken': 'true', }) Interceptor 의 onRequest 메서드에서 options.headers 가 빈값으로 넘어와 if (options.headers['accessToken'] == 'true') 조건을 타지 않습니다. @Headers 가 선언된 restaurant_repository.dart 에는 아래처럼 처리가 되어있고요. import 'package:dio/dio.dart' hide Headers; import 'package:retrofit/retrofit.dart'; 아래 링크를 찾아서 https://github.com/Mindinventory/flutter-retrofit/issues/6 아래처럼 수정을 하면 정상적으로 동작 하는데 @Headers({ 'accessToken': 'true', }) Future<RestaurantDetailModel> getRestaurantDetail({ @Header('accessToken') required String accessToken, @Path() required String id, }); 동영상에서는 되고 제가 같은 방식으로 할 땐 안돼서 혹시 이렇게 처리하는게 맞는지, 아니면 어떤 부분이 잘못돼서 @Headers 로 값을 줬을 때 빈값으로 넘어오는지 궁금합니다.
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요 영한님. QueryDsl과 @EntityGraph 사용 기준에 대해 궁금한 부분이 생겨서 질문 남깁니다. fetchJoin을 할 때, 여러가지 방법이 있겠지만 QueryDsl과 @EntityGraph이 가장 편리한 방법이라고 생각합니다. 저의 경우엔 @EntityGraph가 가독성이 더 좋다고 느껴서 간단한 조회용 페치조인의 경우에 사용하고, 검색조건이 있는 복잡한 조회의 경우엔 Querydsl을 사용하는데요. 실제로 이 둘을 사용할 때 어떤 것에 우선순위를 두시는지 궁금합니다. 강의 잘 듣고 있습니다. 감사합니다!
스프링 부트에서 DTO를 만들 때 @setter을 빼고 @Builder로 하는게 좋다고 들었습니다. 근데 책이랑 구글을 찾아보다 보니 두 가지의 방법으로 하는 것을 봤는데 무슨 차이인지 무엇이 더 좋은 방법인지를 모르겠어서 질문드립니다. 생성자 위에 @Builder를 사용하는 방법 @Getter //Getter 생성 public class LombokPerson { private String name; private String grade; private int age; @Builder // 생성자 만든 후 위에 @Build 어노테이션 적용 public LombokPerson(String name, String grade, int age) { this.name = name; this.grade = grade; this.age = age; } 클래스 위에 @Builder를 사용하면서 @Setter도 사용하는 방법 @ToString @Setter @Getter @Builder @NoArgsConstructor @AllArgsConstructor public class UserDTO { private String token; private String userName; private String password; private String id; } 2번째의 방법이 책에서 나온 방법인데 @Setter이 바뀔 수도 있어서 @Builder로 생성자로 받는거로 알고 있는데 여기서는 @Setter과 @Builder을 같이 쓰더라구여. 이거에 대해서 알려주세요 ㅠㅠ
java11, springboot2.7.1로 프로젝트 진행했던 프로젝트를 열어 실행하니 에러가 발생합니다. 해결하지 못하여 질문드립니다! 발생에러 11:46:16 AM: Executing ':RandomApplication.main()'... > Task :compileJava FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.4.1/userguide/command_line_interface.html#sec:command_line_warnings 1 actionable task: 1 executed FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 652ms 11:46:16 AM: Execution finished ':RandomApplication.main()'. Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html 시도 java JDK 버전 확인, 빌드 자동 실행 설정 등.. 구글링해서 찾아봤으나 해결하지 못했습니다ㅠㅠ 검색해보면 jaxb -api:. 를 기준으로 나오는데, 제 에러는 jsxb -api 입니다 이 둘의 차이는 무엇인가요?
아래 코드를 복사 붙이기 하니깐 오류가 나네요...어떻게 수정해야하나요? 추가하기 버튼을 누를 때, textController 를 이용하여 TextField 에 입력된 가져와 보도록 하겠습니다. 코드스니펫을 복사해 132번째 라인 맨 뒤에 추가해 주세요. String job = textController.text; // 값 가져오기 print(job);
"/api/v2/simple-orders " 이 url로 호출했을 때, (1) order테이블에서 가져오는 쿼리 1번 => (2개의 데이터) (2) member 쿼리 1번 * 2 (3) delivery 쿼리 1번 * 2 해서 총 5번이 나오는 걸로 알고 있습니다. 근데 현재 로그에서 총 쿼리가 7번이 나가고 있습니다. 코드를 따라쳐보면서 했는데도 왜 다르게 나가는지 원인을 짐작하기가 힘듭니다. 현재 제 쿼리는 (1) order 테이블에서 가져오는 쿼리 1번 (2) member 쿼리 1번 (3) delivery 쿼리 1번 (4) delivery id 조건절로 order 찾는 쿼리 1번 (2)~(4)번 한 번 더 반복 이렇게 해서 총 7번 쿼리가 나가게 됩니다. 쿼리만 보고 어떤 부분때문에 더 나가게 됐는지 짐작할 수 있을까요? 엔티티 간의 연관관계 매핑은 강의를 보면서 했기 때문에 제가 중간에 놓쳤나 생각이 들기도 하네요ㅜ 원인을 짐작하기가 어렵습니다. select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 join member m1_0 on m1_0.member_id=o1_0.member_id fetch first ? rows only 2023-03-23T19:03:54.387+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where m1_0.member_id=? 2023-03-23T19:03:54.390+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.delivery_id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where d1_0.delivery_id=? 2023-03-23T19:03:54.393+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-03-23T19:03:54.395+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where m1_0.member_id=? 2023-03-23T19:03:54.396+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.delivery_id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where d1_0.delivery_id=? 2023-03-23T19:03:54.397+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=?
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요 강의 너무 잘 듣고 있습니다. 강의를 쭉 따라오다가 글작성시 key를 리턴 받으려고 했는데 null 이 들어오길래 drift_database 파일로 와서 Future<int> 를 명시했는데요 (그전에는 요것을 제가 추가를 안해놓고 createdSchedule 부터 작성했었어요.) 그랬더니 아래와 같이 null 이 들어올 수 있다며 ? 를 붙이라고 에러가 나네요. 이것 처음에 디비 생성할 때부터 (Future<int>를 명시안해놓고 생성했기 때문에) 이미 잘못된 걸까요?
강사님 강의를 보고 최근에 프로젝트를 하다 궁금한게 생겨 질문 남기게 되었습니다. Product <-> Category Entity 다대다 매핑을 위해 product(OneToMany) <-> product_category(ManyToOne) <-> category(OneToMany) 위와 같은 테이블로 매핑한 상태이고 join 상속 전략으로 district_category 테이블도 생성 하였습니다. district_category를 쿼리 파라미터로 받고 해당 district_category를 갖고 있는 상품들을 검색하고 페이징을 하는 로직을 짠다고 했을때 두가지 방법이 생각났는데 둘 중 어느게 더 적합한지 모르겠습니다 검색어를 바탕으로 product_category에서 Product를 EntityGraph로 같이 찾은 후에 찾은 ProductCategory.getproduct() 와 같은 방식 SearchService Category category = districtCategoryRepository.findByDistrictEnum(districtEnum) .orElseThrow(() -> new ProductException(ProductExceptionType.CATEGORY_NOT_FOUND)); return new ProductCategoryToProductPage(productCategoryRepository.findAllByCategory(pageable, category)); ProductCategoryRepository @EntityGraph(attributePaths = "product") Page<ProductCategory> findAllByCategory(Pageable pageable, Category category); ProductCategoryToProduct public ProductCategoryToProductPage(Page<ProductCategory> page) { this.content.addAll(page.getContent().stream() .map(ProductCategory::getProduct) .map(ProductListGetResponseDTO::new) .collect(toList())); this.totalPages = page.getTotalPages(); this.totalElements = page.getTotalElements(); this.pageNumber = page.getNumber() + 1; this.size = page.getSize(); } 발생 쿼리문 select districtca0_.category_id as category2_1_, districtca0_1_.parent_id as parent_i3_1_, districtca0_.district_enum as district1_2_ from district_category districtca0_ inner join category districtca0_1_ on districtca0_.category_id=districtca0_1_.category_id where districtca0_.district_enum=? select productcat0_.product_category_id as product_1_8_0_, product1_.product_id as product_1_7_1_, productcat0_.category_id as category2_8_0_, productcat0_.product_id as product_3_8_0_, product1_.created_date as created_2_7_1_, product1_.content_detail as content_3_7_1_, product1_.product_content as product_4_7_1_, product1_.product_name as product_5_7_1_, product1_.product_price as product_6_7_1_, product1_.product_status as product_7_7_1_, product1_.product_thumbnail as product_8_7_1_ from product_category productcat0_ left outer join product product1_ on productcat0_.product_id=product1_.product_id where productcat0_.category_id=? limit ? select count(productcat0_.product_category_id) as col_0_0_ from product_category productcat0_ where productcat0_.category_id=? 검색어를 바탕으로 product에서 직접 찾기 (데이터 뻥튀기의 문제는 쿼리dsl 이용 productId로 groupBy로 해결) 글 쓰고 생각해보니 A카테고리는 B라는 상품 안에서는 하나밖에 있을 수가 없으니 굳이 groupBy를 안써도 될거 같네요 SearchService Category category = districtCategoryRepository.findByDistrictEnum(districtEnum) .orElseThrow(() -> new ProductException(ProductExceptionType.CATEGORY_NOT_FOUND)); return productRepository.findAllByCategory(pageable, category); ProductRepository @Override public Page<Product> findAllByCategory(Pageable pageable, Category category) { List<Product> content = queryFactory.selectFrom(product) .join(product.productCategories, productCategory) .where(productCategory.category.categoryId.eq(category.getCategoryId())) .groupBy(product.productId) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch(); Long total = queryFactory .select(Wildcard.count) .from(product) .join(product.productCategories, productCategory) .where(productCategory.category.categoryId.eq(category.getCategoryId())) .fetchOne(); return new PageImpl<>(content, pageable, total); } 발생 쿼리문 select districtca0_.category_id as category2_1_, districtca0_1_.parent_id as parent_i3_1_, districtca0_.district_enum as district1_2_ from district_category districtca0_ inner join category districtca0_1_ on districtca0_.category_id=districtca0_1_.category_id where districtca0_.district_enum=? select product0_.product_id as product_1_7_, product0_.created_date as created_2_7_, product0_.content_detail as content_3_7_, product0_.product_content as product_4_7_, product0_.product_name as product_5_7_, product0_.product_price as product_6_7_, product0_.product_status as product_7_7_, product0_.product_thumbnail as product_8_7_ from product product0_ inner join product_category productcat1_ on product0_.product_id=productcat1_.product_id where productcat1_.category_id=? group by product0_.product_id limit ? select count(*) as col_0_0_ from product product0_ inner join product_category productcat1_ on product0_.product_id=productcat1_.product_id where productcat1_.category_id=?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요 영한님, 강의 잘 듣고 있습니다! 강의에서 JPA가 생성해준 테이블을 그대로 쓰면 안되고, JPA가 쓴 DDL을 다듬어서 쓴다고 하셨는데 생각해보니 저는 토이프로젝트에서 항상 JPA가 만들어주는 그대로 썼던 것 같습니다. 그렇다면 지금 예제에서는 어떤 점을 보완하는게 필요할까요? 감사합니다.
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요! 앱 만들어보고 싶어서 수강신청을 하게됐습니다. 반갑습니다ㅎㅎ 빌드 환경에서 궁금한게 있습니다...! Windows에서 작업한 프로젝트를 그대로 Ios에서 빌드용 프로젝트로 사용이 가능한가요? 혹시 IOS에서는 IOS 빌드 및 출시와 Android 빌드 및 출시 두 개 다 가능한가요? 만약에 2번 경우가 가능하면 아에 맥북을 사는 것도 고려를 해봐야할것같네요...ㅎㅎ 그럼 중급수업까지 잘 들어보겠습니다. 감사합니다.
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
FutureBuider if문 해석 질문 FutureBuilder에서 if(snapshot.hasData && startTime == null){ } 이 부분이 이해가 가지 않습니다. 강의에서는 "데이터는 존재하지만 우리가 한번도 startTime을 설정하지 않았을 경우"라고 조건을 해석해주셨는데, 우리가 만약 스케줄 카드 내용을 수정하는 경우라면 분명 startTime(시작시간)라는 변수에 몇시인지 입력이 되어있는 상태일텐데 왜 startTime을 설정하지 않았을 경우를 고려해야 하는지 몇번을 돌려봐도 이해가 잘 안됩니다. initialValue 질문 initialValue에서 왜 기본값을 꼭 지정해주어야만 스케줄 카드 내용을 수정할 수 있는지 정확히 이해가 가지 않습니다. 만약 기본값이 안되어있다면 아예 카드 내용을 수정할 수 없는지 궁금합니다. widget. 질문 이부분은 전부터 계속 궁금했는데, 어떤 변수에는 widget을 붙이는 경우가 많던데 특별히 widget이 필요한 변수인지 확인할 수 있나요? 답변 부탁드립니다...
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요 선생님. 플러터 공부 중에 궁금한 것이 있어 문의드렸습니다. 부모 위젯에서 Voidcallback파라미터로 함수를 불러오고, 그 함수를 버튼 위젯의 onpressed에서 불러와서 활용할 수 있다는 것을 활용하여 자식 위젯에서의 함수와 함께 onpressed에서 부모위젯의 함수를 사용하고자 코드를 작성해보았습니다. 오류 없이 실행되긴 하지만, 부모위젯에서 가져온 voidcallback함수가 작동하지 않습니다. 어떻게 해야 버튼을 눌렀을 때, 자식 위젯에서의 함수와 부모위젯에서의 함수를 함께 실행할 수 있나요? 부모위젯과 자식 위젯 모두 Stateful함수이고, 부모위젯에서 가져온 함수는 이 함수이며, 자식위젯에서 함께 실행하고자 하는 함수는 위와 같습니다.