Skip to content

Conversation

@sanketh2222
Copy link

No description provided.

@sanketh2222
Copy link
Author

@rohitnandi12 Please review PR , i'm will double check this tomorrow / day after again

@rohitnandi12 rohitnandi12 changed the base branch from feature/9-admin-vendor-portal to dev December 8, 2024 13:04
@rohitnandi12 rohitnandi12 changed the base branch from dev to feature/9-admin-vendor-portal December 8, 2024 13:05
import org.springframework.data.web.SortDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expand

@PageableDefault(page = 0, size = 10)
@SortDefault(sort = "name", direction = Sort.Direction.ASC) Pageable pageable) {

Page<Vendor> vendorsPage = adminService.searchVendors(searchRequest, pageable);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service should return Page

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adminService.searchVendors(searchRequest, pageable); method is already returning a Page right,
not understanding this comment


@ManyToOne //fetch = FetchType.LAZY
@JoinColumn(name = "seat_id", nullable = false)
private Seat seat;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may lead to a Hibernate N+1 query problem.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have tried to resolve this with eager fetching , please confirm if this solves the issue


@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "address_id")
private Address address;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this ManyToOne? One Venue can have only one Address right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logic is 1 address can belong to multiple venues (assuming they are nearby) , 1 venue will have 1 address.
we can discuss and clarify things


@GetMapping
public ResponseEntity<?> getAllVendors(
@ModelAttribute VendorSearchRequest searchRequest,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ModelAttribute is optional right?

sanketh2222 and others added 4 commits December 14, 2024 20:48
…nto feature/9-admin-vendor-portal

# Conflicts:
#	book-my-show/backend/java/bms-monolith/src/main/java/org/lbcc/bms/bms_monolith/admin/controller/AdminVendorOnboardingController.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants