Sweetguy10's Posts
Nairaland Forum › Sweetguy10's Profile › Sweetguy10's Posts
1 2 3 4 5 6 7 8 9 10 (of 58 pages)
Singlecliq:Thanks duly appreciated |
richebony:I tried running the code but it came back with an empty array response after inspecting the console. I made sure that I logged in with a Marketer type role and spring security detected Authorities type Marketer. Could it be from the authentication.getName parameter of the security context because in my user class what I have is firstName and lastName variables not Name variable ? I plan to refactor and change the first and last name variables to just Name . Do you think that should fix it ? Thanks for your support Jah bless
|
Thanks much , I'll implement and get back to you with response |
richebony:Thanks very much for the response . I already have a custom implementation on the customer repo here it is . @Query("select customer from Customer customer join customer.marketer marketer where marketer = :marketer" ![]() List<Customer> findByMarketer(User marketer); Now what I am thinking is how the passed :marketer parameter in the query get the logged in marketer name and display the Customers registered with the marketer's name. Thanks much I really appreciate your reply. I'll as well look into the getPrincipal method from spring security. Here is the controller where other endpoints are implemented @RestController public class CustomerController { @Autowired CustomerAccountService customerRepo; @GetMapping(value="list/Customers" ![]() public List<Customer> getCustomers() { return customerRepo.getCustomers(); } @GetMapping(value = "list/customer/{id}" ![]() public Optional<Customer> getCustomer (@PathVariable Long id) { return customerRepo.getCustomer(id); } @DeleteMapping(value="/deleteCustomer/{id}" ![]() public void deleteCustomer(@PathVariable Long id) { customerRepo.deleteCustomer(id); } ............................................................................................................................................ |
I have a set of Users with different role types Marketer , Admin, General Manager. When a customer account is registered , there is a column that gets the name of the Marketer assigned to the Customer . I have created a @ManyToOne and @OneToMany relationship between Users and Customers. When User type Marketer logs in to the software , I want the marketer to see only customers registered to the logged in Marketer name. It seems complicated because first I need to get the logged in Marketer details using the username then get the first and last name then display customer list assigned to the name. Please help i need to deliver the project soon. This is the Customer entity @Entity @JsonIgnoreProperties({"hibernateLazyInitializer","handler"}) public class Customer implements Serializable { /** * */ private static final long serialVersionUID = 8348682056500740593L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; private String userName; private String password; private String firstName ; private String lastName; private String gender; private String Address; private String idNumber; private String phoneNumber; private String email; @DateTimeFormat(pattern = "yyyy-MM-dd" ![]() private Date dateOfBirth; @DateTimeFormat(pattern = "yyyy-MM-dd" ![]() private Date registrationDate; @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY ) @JoinColumn(name="marketer_id" private User marketer ; @JsonBackReference @OneToMany(mappedBy="customer_id",cascade = CascadeType.ALL, targetEntity=Investment.class) private List <Investment> investment; This is the User Entity @Entity public class User { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; private String firstName ; private String lastName; private String username; private String password; @DateTimeFormat(pattern = "yyyy-MM-dd" ![]() private Date createdDate; @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinTable( name = "users_roles", joinColumns = @JoinColumn(name = "user_id" ,inverseJoinColumns = @JoinColumn(name = "role_id" ![]() ) private Set<UserRole> userRole = new HashSet<>(); @Enumerated(EnumType.STRING) private UserStatus status; @JsonBackReference @OneToMany(mappedBy="marketer",cascade = CascadeType.ALL, targetEntity=Customer.class) private List <Customer> customer; This is the User Repository that contains a FindByUsername method that's being used by JWT authentication manager @Repository public interface UserAccountRepository extends JpaRepository <User, Long> { Optional<User> findById(Long id); User findByUsername(String username); } |
I am heart broken , I hissed like 300 times in five minutes , my wife kept telling me to go get a drink. Early in my 30s and never thought I would shed a tear for football. Messi is really gone I am depressed . Ah .. I am appalled beyond words, maybe its still a power game by barca board to make LaLiga bend their rules Nd not lose their biggest ever revenue generator . This is beyond me |
Something is definitely wrong with Imo state. |
Someone should please drop streaming link |
Where can I live stream the copa final match please ? |
Please where can I live stream the copa final match ? |
Keep deceiving yourself ... |
Woah......spent the day reading about Ateke Tom , Tompolo, Asari Dokubo, Gbaramatou kingdom, Egbesu, John Togo , Boyloaf, Icelanders, Greenlanders, Ogoni, MEND , NDA etc thanks to these two guys. Una don try i hail . #saynotocultism |
The guy shouted HBK so they will not hurt him because him self na airlord but not with that particular rolling squad ....who knows he might be the one that did the snitching on the aye wey dem come fall self ....when they leave , the guy sef will evacuate the premises......... Say no to cultism , chai ! it will take lots to tackle cultism especially in Edo state as a whole ... |
BigBabyJesus:Lol this guy dey craze ![]() |
GOD please i beg you , help me leave this country with my family ASAP ...NIGERIA HAS NOSEDIVED . |
Abi shey the same PC no be NAS ? |
Someone should post it on filehost too so it can get a broader reach . |
Nocturnal beings, apache na only una my toto clappa for . Asides the juju reasons , moving around only late at night will turn you to something else .... I've been there, mine wasn't for cultism or juju but official ... Las las wetin be the gain ? Vehemently say no to cultism , please say no to culsitm . It's deeper than these write ups , please say no to cultism |
......things get gory really after even the game . I’ve seen hardened cultists run mad suddenly after their sojourn n tapes ( for those that survive hits et al ) , indeeed spirituality tied to cultism is extremely stronger than thought ...... I remember the words of my guy 4.... he said and I quote “ E get some kind things wey after person do , he gats do some kind things to clear way for am , or else Na madness or eternal hard luck/ sorrow .... “ the spiritual path... |
NewDelhi:He said ..." Bird wey dey help Men Fly " ... He is a philosopher , don't be so sure with your assertions. |
Give it to the Northerners , they know how to occupy space and even collect the space from they that allotted it to them . Politically they’ve gijacked APC from Tinubu ...it’s evident everywhere , give an aboki small space and in few years you’ll see him encroach your space and even pursue you . They’ve taken over the okada parks in almost all of Lagos . Same thing that was done to Afonja - we will learn by force ! |
When I was in 100L I ignorantly dated a black bra girl until she opened her mouth and told me herself . Though I’ve always noticed she wears black pants and bra/undies most times , most of them are lesbos etc .....how we went our separate ways is a story for another day though i had to run away from school for close to a month as she was threatening me with fire and brimstones.... In 400L I dated an Aloress , their male counterpart number 3 girlfriend . Screwed her anyhow till the guy got to know and started looking for me and even placed a bounty on my head , stupid idiot ..... The downside is those female cultists are always possessed . InFact most of them are witches , Nymphomaniacs , petty thieves and THEY ARE ALL PROSTITUTES . |
Please can someone enlighten me , why is Fayemi of Ekiti among those opposing Tinubu ? I understand the grievances of Amosun , the northern Governors and Amechi but what’s Fayemi’s reasons ? Is it because of 2023 presidency bid ? |
IMASTEX:I laughed sooooooooooo hard ! You are a looney |
My car audio system stopped working after an interior car wash . Please what could be wrong ? |
How do I remove this there is no God but allah ?? I didn’t even post just mistakenly pressed it . This is insane ! I’m not a Muslim please Seun get that declaration off my profile . |
I’m sorry I want to revisit the Juju is real and is not real topic again , I’m not trying to derail ... just trying to bring credence to the topic . Kindly view this thread and see REAL LIFE EXPERIENCES shared by lawyers ... then you’ll know there is more to this life . https://twitter.com/segunoladejo_/status/1261267306866491395 Shalom |
This man’s brain is completely dead . This is the greatest mistake Nigerians have ever made politically . |
Samadhii:I learnt software dev at NIIT, the full stack Java course cost about 300k . The package includes HTML , JavaScript , RDBMS (Database management ) , Hibernate for ORM , Core Java and all enterprise Java frameworks - JSP , JSF , Struts , Spring MVC with well detailed materials/books and class exercises . Lots of people will tell you that NIIT is not as it was anymore but during my time (2017) I was lucky to have a very interactive and supportive tutor . You can as well try Aptech among others. I learnt Angular , PHP (Laravel) , Spring boot on my own . |
Samadhii:You can self teach yourself or go to any of the information tech training institutes in the country(which is better as you will have a coding tutor to help put you through some loopholes -no pun intended ) . The language of choice depends on what aspect of IT you want to go into .. If you're interested in mobile dev , I'll advice you learn Kotlin or Java , Data analysis/science - Python , Web dev - Php, Visual basic, Software development - Java , game dev - C#/C ..... Java cuts across lots of platform though and it has lots of libraries . Lots of corporations use Java for their back-end functionality too so you'll be readily needed . |
Studied Biochemistry Presently working as a software engineer + web developer |

I am depressed . Ah .. I am appalled beyond words, maybe its still a power game by barca board to make LaLiga bend their rules Nd not lose their biggest ever revenue generator . This is beyond me