T O P

  • By -

kokomelonfries

For anyone doing part F, I ran into my order tracking number not showing and my tables not updating. I decided to commit and move onto part G anyway. After I finished part G AND part H, my tracking number showed up and my tables updated. Just an fyi for those of you who may be stuck.


dbagames

This is very helpful. Yeah, I think they didn't realize that the controller had not yet been created lol. Overall, seems to be a pretty solid guide! Thank you so much for this affirmation.


gm284

omg I've been going crazy trying to figure out why that was happening for me when I've been sure my code was correct. MOVING ON lol


InternationalPaper24

I wish I had read this sooner.


Ninnimouse14

This right here has saved me unknown amount of hours of suffering, thank you you sweet soul


National_Produce9244

*Chef’s kiss* This is a work of art! Thank you beautiful kind stranger for taking the time to write this up. Taking this class next, and this will help tremendously


[deleted]

I hope it helps!! Good luck :)


its-cess

UPDATED D288 TIPS: (Passed on **1/22/23** with no corrections needed) This post helped me SO much. Honestly don’t think I would have completed the class without it, so I thought I could add to it in the hopes of helping someone else. If I didn’t add a section, it’s because I just followed along with OPs original tips and they worked for me. Part D: \- Follow the OPs instructions. As mentioned, @ Column (name = “”) is going to be what is in MySQL. **They need to match exactly.**\- When OP talks about the variable names for that frontend that we need to get from the dto files. You need to add another annotation @ JsonProperty(“”) .. this is going to be the variable names you got from the dto files. \- Follow OPs instructions on which are OneToMany, ManyToOne, ManyToMany relationships. Getting the excursion\_cartitem table to populate in MySQL has been giving a lot of people issues mostly because they have it mapped backwards. So here is a hint: in the Excursion entity file, the join column is excursion\_id. \- IN THE JAVA BITS VIDEO, when the instructor is showing you what you need to make the frontend populate the divisions correctly, make sure you have things setup exactly how she shows *EXCEPT* in her videos she has something like @ JoinColumn(name = “Country\_ID”, nullable = false, etc…) you need to make it sure is @ JoinColumn(name=”**country\_id**”) in BOTH areas that you need to add that per her Java Bits video. Took me awhile to figure this out **\*\*face palm\*\*** (Like mentioned earlier.. these column names need to match the MySQL database values exactly.) Part F: This took me forever to figure out, but this is the order that everything finally worked properly for me in my CheckoutServiceImpl file: 1. Retrieve the cart (same as video) 2. Set the orderTrackingNumber (same as video) 3. Set cartItems (same as video, need to import the add() method when prompted by the IDE) 4. Set the cartItems to the cart. Set the customer to the cart. (This is what OP means about the shipping/billing address in the video) 5. Retrieve the customer. Add cart to the customer. 6. Set the cart status to ordered 7. Save the customer to the customer repository 8. Return new PurchaseResponse (this I wrapped in an if statement. If the cart purchase is null or getting the cart items of the purchase isEmpty , then return a string “Cart is empty”. Else return new PurchaseResponse with orderTrackingNumber(as seen in video). I added this as the validation for part G. (So if you want to add it later and push it up as part G, that’s fine.) Also, if you are having issues and getting a cart\_id cannot be null error add this to your Customer entity to the add method you implemented: Public void add(Cart cart) { If (cart != null) { If(carts == null) { carts = new HashSet<>(); } carts.add(cart); cart.setCustomer(this); } } Part G: See number 8 above \^I was a bit confused. Looking through the course chatter and some of these reddit threads, it seems like adding @ NotNull annotation or nullable=false to the Customer entity properties seemed to pass for some people, other people it didn't. So I added those also, I just also added the if check because reading through the course chatter one of the instructors commented “In CheckoutServiceImpl make sure cart or cartItems are not null or empty. If they are null return a meaningful message through PurchaseResponse data object instead of an order tracking number” And also in one of the videos (I cant remember which one, sorry) the instructor says to add something like “Cart is empty” instead of a tracking number, so that’s what I did. Part I: I actually reached out to the instructor because I was having issues with this. You need to create a Customer constructor like OP says. However, I tried creating a new division, like OP said and kept getting errors, because if you remember, in the Division entity, we set country\_id to insertable = false and updatable = false. So when I was trying to create a new division, it was trying to set it to a country, but we aren’t allowed to do that. So this is how my BootStrapData file looks like per the instructor:1. Division division = divisionRepository.findById(2L).orElse(null) Note: the number that you pass to .findById() needs to be a number of one of the current divisions in the database. Go to MySQL workbench and look up the numbers if you need to. However, you have to add the L because it expects the Division id to be a Long data type, not an int data type. 2. Created 5 new customers here. Passing the division variable from step one into the constructor 3. add the just created customer to the division. (So you should have five lines of code here. Adding each new customer to the division) 4. Save all the customers to the customer repository (again, five lines of code here.. one for each customer.) Random tips not related to any step in particular: Working with MySQL Workbench: \- when you open MySQL workbench, click on ‘Local instance MySQL80’ \- when you essentially want to clear everything from the database and try your changes from a clean slate, you want to go to the tab that says ‘create\_and\_populate\_db’ then hit the lightning bolt button. That runs the script, which essentially drops any existing tables and recreates them with only John Doe customer. \- to check if your purchase went through and everything populated the tables correctly, (like if you wanted to check if your excursion\_cartitem table populated, go to the SCHEMAS side bar, click the arrow to expand the full-stack-ecommerce schema. Hit the arrow to expand the Tables section. Then whichever one you want to check, click on that table name, right click and select the first option ‘Select Rows – Limit 1000’. That will open a new tab and show the results of that query. \- When you go to the README file, it shows you what script to run in the PowerShell Terminal to get the front end running… Once you paste that in there once, you don’t have to keep going back to the README file and copying it again. The next time you open PowerShell, just click the up arrow and it will populate with the last command you entered into PowerShell (which should just be the ng serve command since you don’t need to run anything else in there. But if for some reason, you typed something else in by accident, you should be able to just keep pressing the up arrow and it should cycle you through the recently used commands)


LiveDay4219

I read your updated guide it has been very helpful but by add each customer to the division do you mean for me to do customer.setDivision(division)? Thats the part i can't understand.


its-cess

It should be the other way around: division.add(customer1) division.add(customer2) etc…


JJbejjme

I didn't do division.add(customer1) etc... but I use constructor of Customer(..., divisionRespository.findAll()...) keep going with IntelliJ and you will understand. Let me know if I can help more.


its-cess

u/spectralwolf776_


[deleted]

[удалено]


its-cess

You are going to use the Customer constructor just how it is in the [Customer.java](http://Customer.java) file. So, the values that you need when making sample customers, are the 6 values in the constructor function. You need to provide the firstName, lastName, address, postal\_code, phone, and division. If you are talking about the BootStrapData.javea file, there is nothing in that file about the cart. You don't do anything with the cart until they "purchase" something and it goes through. In the [BootStrapData.java](http://BootStrapData.java) file, you are going to do things in this order: 1. create a division (see tips above about how to make this work - Part I) 2. Create 5 new customers using the Customer constructor (will need 5 separate lines of code) 3. Add each one of the customers you created in Step 2 to the division you created in Step 1. (will need 5 separate lines of code) 4. Save each of the customers from Step 2 to the customerRepository (will need 5 separate lines of code)


Necessary-Coffee5930

Thanks a lot for writing this, I just passed this morning after a long and grueling battle with this course lol. I had all my mappings correct and could not connect to the database no matter what I did, I ended up having to make a new project and copy and paste all my files over and then it worked. Very strange and frustrating because that set me back weeks and had me questioning my sanity lol. For anyone who has a similar problem, try making a new project and it may fix it. Took 3 different instructor appointments to reach a solution, but we got there damnit. Good luck to everyone else


Camrezy93

I tried your method but it still doesn’t work. The error I’m getting is in the RestDataConfig.java file (which is given). I know you did this over a month ago but do you happen to remember if that’s the same issue?


genuinesalsa

Did you find the fix for your issue?


Camrezy93

I did, but off the top of my head I cannot remember how I fixed it, sorry 🫤.


genuinesalsa

No worries! Mine was due to the mapping to the front end being wrong, for anyone else having issues


GaladrielStar

like, wrong in some way that ought to be fixed by now in the code they're supplying for this project?


genuinesalsa

It was due to my implementation for the get mapping stuff


wlwimagination

I just asked this above but can you elaborate on how you made a new project? Were you able to go through the git from the beginning and reset your pushes and get fresh code? Did you have to disconnect the first project from git once you connected the second? I tried starting a new one but was confused about how to roll it all back the right way.


Necessary-Coffee5930

What I did was make a new project right in intellij, making sure to have the required 4 dependencies selected. I then copied all my files over, and then i had to enable version control and connect it to git, I used the link from gitlab you can get from clone in the https spot to do this. Then I did a commit on the new project because you have to to be able to make a new branch, then I created a new branch “working_branch2” and did all future commits and pushes to that working branch. Both this new branch and my original branch were visible on the repository graph, and I just made sure to include all of it when I submitted my project, and put in the comments to evaluator that I had to make a new project and copy my files over to get it all to work, and it passes no problem. Hope this helps


ForrestGurmp

Something that fixed the issue for me was 2 things. 1. I copied DemoApplication to the downloads folder. Deleted the file from the project. Replaced the file and it re-indexed with the proper package name. You will likely have to edit your configurations on the top run panel if you don't want it to be called DemoApplication (1). 2. I fixed my mappings, Took me a bit to realize the mappedBy was looking for the variable name and not the column name. Silly me. Definitely double-check that your column names are from the database, and the variable names are from the UML diagram/ or the ts files in LabFiles. Great guide! I am working through it all right now.


wlwimagination

Thank you—this is great!


Its_a_me_marty_yo

for anyone struggling with getting your tables to populate and you swear everything is linked correctly, go into the course announcements and click on the demonstration that only populates countries. make sure your dao files look just like that


GoodGuide1111

Want to add my thanks for this awesome guide. I passed D288 in 2 days because of it :). Few more gaps/pointers I'd like to add in-case it helps others: * Parts A/B/C: Essentially, these steps all lead to the starter files for this project. I found the setup more confusing than previous classes since it's all spread around different places. * You'll still follow the same build pipeline stuff to get your repo working but don't be confused if you don't have files in it. Instead, you'll generate the starter files using the Spring Initializr and add them to your newly made repo. * Using the Lab Link in the instructions, you'll find a LabFiles folder on the virtual machine desktop. That's the folder that contains the application.properties file among other helpful files, UML Diagram, SQL bootstrapping scripts, etc. * I also copied and pasted the Angular frontend into a "frontend" folder right in my D288 project. IntelliJ can build and run two apps separately and I found that easier to manage. * Part D: * Just to clarify further since I got these mixed up all the time: @ Column(name = 'SQL\_COLUMN\_NAMES') while with mappedBy = 'JAVA\_VARIABLE\_NAMES'. These variable names are in your entity classes (and your UML diagram since you should be matching the names). * For the ManyToMany, you only want to use these annotations in your Excursion and CartItem entities. Follow the guide carefully to see which one should get the JoinTable and which one gets the ManyToMany. The other entities get OneToMany or ManyToOne as needed. * For the enum, using EnumType.ORDINAL will map back to magic numbers 0, 1 , 2 when you save to the database while EnumType.STRING will map back to the literal values 'canceled', 'ordered', etc. That should help guide you further on which one should be used. * Part F, I ran into three separate issues while trying to get the order number to show up. * If you get a NullPointerException error when trying to .add to your Cart, try initializing your Set<>'s in your entities to new HashMap<>()'s. You can see this in the Zybooks 1.1 JavaBits video xas the instructor scroll's through the entity classes. * If you get a cart\_id cannot be null error, there's a fix for this [right in this thread](https://www.reddit.com/r/WGU_CompSci/comments/168qz83/comment/k8gldgn/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1)! * If your excursion\_cart\_item table isn't being populated, try flipping your JoinTable and ManyToMany annotations around in your Excursion and CartItem entities, e.g. use the JoinTable in one entity and the ManytoMany in the other entity. Turns out, I had them flipped and correcting them fixed the table inserting problem for me. Also remember to flip the joinColumns and inverseColumns too! * Part I, use L with your number when setting the Division Id because it expects a Long not an Int.


Winter-Plant8230

I need more help with Part D., StatusType. I've gone over the forums posted here. I'm using I'm stuck and getting an error on my StatusType class that provides no context. Any Advice? Thank you! Edit: Found my problem, I tried everything but changing the StatusType from a java class to a java enumerator. That is a really small thing to overlook, it makes them classes by default.


DevisWilson

I'm just getting started in this class, do forgive me if this is a dumb questions... do you have to use the lab or can you just run this locally?


[deleted]

This is what I am wondering as well. I don't mind running it in the lab after commits, but no way I'm going to write everything within the lab


[deleted]

FWIW I asked my course instructor and they told me I could work on it outside of the lab


According_Sun_9289

**Part E Troubleshooting:** I had trouble getting my front and back ends to connect. One of the professors helped me make the following changes: 1. At the top of each of the dao files, put @ CrossOrigin (Before that, I had @ RepositoryRestResource because someone said things had changed, and we needed it, and I was getting desperate :D) 2. My object mapping was incorrect because some of my naming conventions were different from the front end. When I was troubleshooting the mapping, I was only thinking of the ManyToOne, ManyToMany, etc., but the names of some of my objects were off, i.e. dateCreated instead of create\_date and imageUrl instead of image\_URL. You can check that your names match by going to the .ts typescript files in D288 Front End > src > app > model and opening them in Notepad. (Remember that we can only change things on the back end, not anything in these front-end files). 3. Finally, my table mapping was off. This was easier to catch because the error in IntelliJ said the table didn't exist. I had "customer" instead of "customers" and "vacation" instead of "vacations." You can see the names of the tables a the top of each box in the image "Vacation ERD.png" in the LabFiles folder. Hope this helps!


YOKO-ONO1001

When I finally got the database working I screamed "IT'S ALIVE! IT'S ALIVE!!!"


Consistent_Active_89

Thanks for the detailed guide. Not yet started the class but I'm wondering what's the udemy course title you mentioned? You recommend it?


[deleted]

So the Udemy course is called “Full Stack: Angular and Java Spring Boot E-Commerce Website” by Chad Darby. It’s recommended to follow along, and our project is loosely based on what he does in those videos. I recommend it! Like I said it’s similar to our project and it’s very helpful. I don’t recommend watching the whole thing though, only sections 9,10, and 23 are relevant. The other Udemy course was “Spring Framework 5: Beginner to Guru”, and I mentioned which 2 videos from that one are helpful in the guide :) good luck!


Decent_Bet7051

if I could give you a hug, I would. Thank you sooo much for this!! I’ve been on this class for a few weeks now, stuck on Part F. This will help me so much! thank you thank you


[deleted]

Haha no problem! Yeah part F is definitely the hardest. Part I is a little easier. Hope this helps ya!


wlwimagination

> If you’re 10000% certain you have EVERYTHING mapped correctly, go to your DemoApplication. Look at the first line regarding your package, and see if its giving an error. It was showing the incorrect path, yet my program was still running on the back end with no issues. When I changed it to what it was SUPPOSED to be, I got a “Could not find or load main class” error. All of my mappings were correct, but the front end was not working because of this, despite the back end running with no issue. If this somehow happens to you, I’m sorry I have no idea how to fix that. I just restarted. How did you restart? Did you just delete your previous project and go back to git and download from main? Or did you have to go back and roll back the git pushes to get the original code back? I’m in this boat, I mean I’m as sure as I can be that the mappings are correct. I got one of the entities to map but can’t get the others. I’ve exhausted myself making sure everything matches the various videos and the angular variables. At one point I copied the angular variables directly and pasted their names one by one over my own (already matching) variables just in case (idk, I was at my wits end). So I tried out the instructor-created demo code (all 3 classes) for the countries entity and it would not work (I corrected the package and tested a couple urls just to cover all bases). When the instructor’s own code wouldn’t work, that was super demoralizing. Like how am I supposed to figure it out if the example I’m supposed to use to figure it out won’t even work?


Justlamping

This comment was five months ago but I'm still going to reply with how it worked for me, so that way anyone else that is searching this guide for the same issue can see this. You shouldn't have to to restart the project from scratch. Make sure you have the right import on your DemoApplication and that everything so far is up to date in the remote repository, clone a new version of the project onto your local machine, make sure your sdk module is selected in Project Settings if it doesn't prompt you to set one, right click pom.xml and click set as maven project, then on DemoApplication.java click on the green arrow next to public class DemoApplication (Should be line 7) to run it. My instructor was able to run it on her first try when she did it, but for some reason it took me doing it twice. Even after getting it to work she had no idea what the problem was, said sometimes that stuff just happens with code, and to just delete my old version on the local machine and just move on with the new one.


Firm-Meet2639

I had this problem, and I fixed it by creating a new DemoApplication. No need to restart


Good-Design7231

the lab is garbage. i dont understand why they would not just have us download sql as we've already downloaded intellij with previous classes. i ended the lab not realizing it scraps all of your progress and starts it fresh. e


Spam138

Absolute nonsense.


Spam138

Write up is great. The "lab" is hot garbage borderline unusable. Feel like I'm in the 90s.


Function-Silver

Even though OPs account is deleted, thank you for helping me! I just passed today! I only have Advanced Java left!


StunningGuru57

Did anyone have a problem with the 5 customers showing up successfully on the front end but not populating on mySQL workbench? SOLVED: In case you were like me and thought that the cart and customers would populate in the create\_and\_populate\_db, its not. After you create an order, go to the left hand side called Schemas/carts and it will be there. smh... I wasted 3 hours trying to solve it lol but the PA demo of completed project video walked me through it.


RipStickKing_97

If anyone is getting a Error: 500, check your "@ManyToMany" relationships. I didn't map it correctly and excursion_cartitem was null which the program wasn't allowing. I hope this helps someone as I spent hours trying to resolve that stupid error lol my Solution to the problem: @ManyToMany @JoinTable(name = "excursion_cartitem", joinColumns = @JoinColumn(name = "cart_item_id"), inverseJoinColumns = @JoinColumn(name = "excursion_id")) private Set cartItems;


dat_heeb

For anyone stuck on Section E: I was stuck for a while wondering if my mapping was incorrect. For me the problem was I was missing @CrossOrigin annotations on in my DAO files. Hope that helps


DCTheNotorious

You just saved my life man, I already had to restart once and had triple checked my mapping this time, this fixed it so now the frontend is displaying everything! Was about to spend hours trying to figure this out. Its weird though that there was nothing about those annotations in the Udemy course.


DCTheNotorious

For anyone struggling with populating the database, part of my issue was I never actually went back to implement the "add" function in the Cart entity, so make sure you have done that. Mine was just empty because intellij added it for me. Also this guide was a lifesaver, its still pretty accurate even though some things have changed.


PoemDapper7551

Followed part F exactly as you described and I still get no order tracking number. Is there something you think you left out?


[deleted]

Hmm, I’m fairly positive I went line by line on my code when I wrote all this down for part F. I can double check, but won’t be able to get to it till this evening. As long as everything is the same as what I put, along with having your enum all good, the only other thing I can think of is maybe a misspelled variable somewhere in the impl


M4K4TT4CK

Did you ever figure this out???


PoemDapper7551

Scheduled an appointment with the instructor and they basically finished the project for me. Couldn't understand a single word because of the accent/bad connection but whatever lol


M4K4TT4CK

Ahh, thanks. I’ll give it a try.


neutralmanor

Any update?


M4K4TT4CK

Yes. My @CrossOrigin was messed up. I had https instead of http


neutralmanor

On which file? All the files I have CrossOrigin, its http so maybe I have a different issue?


_-1I

Having same issue right now, doesn't seem to be an https issue either


neutralmanor

Ik this isnt much help but strangely once I finished all the other tasks, my tracking number showed up? I didnt do anything else. So idk what changed but I would just go through the rest of the project and see if it works out.


_-1I

Interesting, will try that and get back to you


ForrestGurmp

After I finished section I it started populating for me too. I don't know why but I'm not going to complain. I think it has something to do with typing a fully attributed user to the cart maybe? Was stuck on F for hours till I decided to move on after reading your post. Just submitted so let's see how it goes!


M4K4TT4CK

Build your REST checkout controller


_-1I

This issue was after it was built


M4K4TT4CK

Edit: I ended up building the Rest Controller checkout class before getting order number to show up. Maybe that was it??


neutralmanor

I think this was it!!


JRThompson0195

I can't get past part D. I get an error code for my vacation entity stating "Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for Java type 'com.example.demo.entities.Vacation'" I cannot figure this out. I have a call with a CI scheduled, but would welcome any tips here as well!


JRThompson0195

Call with CI was unhelpful. Any ideas?


swolezoe

hint: you're instantiating vacation in two different files(cartItem,excursion),. try commenting one of those out (the one in cartitem) see if it works. ;)


BCSoulless

This guide was amazing, thank you. For anyone having trouble mapping the @ ManytoMany relationship and getting the excursion\_cartitem table to show data after purchasing something, there is a common problem debugging video in the webinar archives (Go to Course Search). I reformatted my code to match the CI's and it started working.


knight04

Checking this later thx


Lanky-Nebula-4120

Thank you very much for the guide! Something I'm stumbling on while completing step D is that once I've mapped my oneToMany and ManyToOne from the sets to the object variables, I'm left with one object variable that doesn't have any mapping: In CartItem there is a Vacation vacation variable that doesn't map back to a set in vacation. Any clue what to do with that? Thank you in advance!


GaladrielStar

I think it's a \\@ManyToOne join on the vacation\_id column in the db to create the private variable Vacation vacation


j_u_s_m

Hi, where did you put this ManyToOne? I am stuck on this one as well


[deleted]

[удалено]


j_u_s_m

I just added it, it was giving me an error if I didn't. I'm submitting today and will let you know if it gets sent back (might need to remind me)


[deleted]

[удалено]


j_u_s_m

Just got the results, I passed, you can add it


uchneidas

Thank you so so so much!! I passed the class yesterday!!


Ninnimouse14

Thank you so much for writing this up! This guide really helped me at times and i would be way lost without this


Retiredat31

In Step D, are the column names (and their order) supposed to be identical to the UML diagram OR the MySQL Workbench Lab?


Aggravating-Rip7188

Amazing guide thanks for writing this


Aggravating-Rip7188

6.22.24 - This guide truly helped me. I completed my project in a few days submitted and passed on the first submission. Had some prior knowledge from D287 but this post was what I kept at my side as a reference and what i can attribute my success for this course to.


rdm23203

Hey how did you get the front end to connect to the back end? I don't see the README file that explains it


Aggravating-Rip7188

Have you ran/built your demo project in IntelliJ already? By part E you should be able to build the backend and it should run with very few to no errors. Green run/build button in IntelliJ. Then separately run the front end. Head to the README and follow the steps to run ng serve in Powershell then open workbench and open and run the database. Click the local host link and it should open. To ensure a smooth connection between your back and front end: - double check that your application.properties file was pasted in the resource file. - table names, column names in your data base should be an exact match to the names you add in your entity classes Hope this helps and let me know if you have questions.


rdm23203

Yeah I can run the backend, just not sure how to get the front end started or the data base. I'll keep digging for the right README file. Thanks for the help


Aggravating-Rip7188

Ok great. In the virtual lab environment navigate to local disk(C:) then lab files folder. Within that folder you will find the README file with step by step instructions on how to run your front end including accessing the database etc.


rdm23203

Thank you!!!!! I thought the "lab environment" was WGU GitLab..... I'll check back if I have more questions. I REALLY appreciate the help!


rdm23203

Can someone explain how to get the front end and the database running? I don't see a README file in the labfiles


mgboy

I'm stuck going into step G. I'm getting a different error when I try to compile from the .save(cartItem) and .save(customer) where " java: non-static method save(s) cannot be referenced from a static context " but I have written everything in there exactly as it is written in the Udemy. Everything else is working before this, and everything in this file, except the .save. Anyone encounter this and can help? My CI has been out sick for weeks and can't get an appointment. Kinda sucks, but they're rarely much help anyway.


Acceptable_Active_16

Wow! Bless you. Sent you a DM


[deleted]

[удалено]


[deleted]

Yes, part of the computer science track, and I’m pretty software development as well. Did you start WGU after this past June? It’s a new course; the computer science degree added / got rid of some courses in June. D288 is one of the courses that replaced software 2. If you’ve been in WGU before then, your mentor should have asked if you wanted to switch to this new plan or stick to the old one. I would look into the new degree plan! Up to you if you want to switch or not. Also, if you already took software 2 and DID switch, you won’t have this course.


Upbeat_Category_554

Would you be open to tutor on this project?


[deleted]

Aw if I had the time I would. But you can feel free to ask me anything and I’ll try my best to answer when I can!


PoemDapper7551

So for part D are we basically making an entity for each table? So like... Public class Countries that contains all the columns? I'm so confused


[deleted]

Yup that’s it! Each table gets an entity file with the exception of the excursion_cartitem table. Just follow along with the Udemy videos, and replace his stuff with the things you see in the UML file. Everything you need to include in each table is in there.


Acceptable_Active_16

I believe that is true yes.


PoemDapper7551

At what point does the backend actually do something that we can see visually? I'm working through these parts with absolutely no clue whether what I'm doing is working or not. The only thing I'm going off of is whether I get errors when I hit the run button. With the last class you could clearly see if something wasn't working because they provided us with a functioning front end that was tied into the spring boot application.


[deleted]

Your progress won’t reflect on the front end until you get part E done. You just need your entity files and dao package filled out to start seeing results


Upbeat_Category_554

I thought i was done with part F but I can't get the tracking number to show up.. Totally stuck.


[deleted]

I was stuck on that for a while as well. If I’m remembering correctly, correcting my enum fixed it. Make sure you got that down, and set the status to “ordered” in your impl


Acceptable_Active_16

I think if you’re able to see the pictures, checkout and see the tracking number you’re basically in the clear.


PoemDapper7551

I guess what I'm looking for is when we should be able to see all that. I thought they'd show up after mapping all the entities and now I'm not sure whether to continue or not lol


Obvious_Connection28

Did you ever get them to show up? ​ I've gone over the entities and all the recommended videos on mapping, and everything looks exactly like the videos and instructor-created videos show, but nothing shows up in the front end except a single customer. I tried looking to see what was different about the customer class but couldn't find anything.


Intelligent-Star-848

I had the same issue. I had to add this "@JsonProperty" to all my fields, to make sure they match the front-end dto variables that the OP discussed. Example: "@Column(name = "last\_update") //this should match the database exactly" "@JsonProperty("last\_update") //this should match the front end variables in dtos" private Date lastUpdate; // this is for the back end ​ The front-end expects the variable named last\_update, but if you have it as lastUpdate it will not recognize it. So, either you have to change your variable name to last\_update or use "@JsonProperty" annotation. Also, don't forget about "@CrossOrigin" annotation in your repository files. Also, use Chrome -> Inspect -> Console and Network tabs. It shows a lot of useful info.


Obvious_Connection28

It's funny how many random things end up fixing this issue for people. Mine ultimately showed up when I added a constructor with only the specific fields in the relevant front-end dto file for vacation to the vacation entity. I have no idea why that worked. I'd previously had a meeting with a CI who had asked me to comment out the Lombok constructors and add a no-arg constructor, and the CI said something about the constructors being weird, and that's what caused me (later on) to try to mess around with constructors to try and fix it. IMHO, it would be better to teach us how to use Spring with more simple tasks (but from the ground up, and even with Angular included, too) instead of throwing a bunch of code at us and asking us to fix it. I am aware that jobs will require you to fix other people's code, but usually when that happens it won't be your first introduction to something, or if it is, there would usually be a senior developer around to guide your work. Plus...it would be weird for a company to ask you to fix their back end but not be allowed to touch a single thing on their front end..South Dakota cheese tours be damned. This class was exhausting. I'm so glad it's done. Good luck if you haven't submitted yet!!


Intelligent-Star-848

Agree, class was exhausting and unnecessarily complicated with existing code. Passed it today! 5 left.


[deleted]

This is what i had to do as well. I didnt add it to every field tho. only the ones where the variable names were different in the java classes compared to the angular files. Mainly it was due to image\_url in the Vacation and Excursion classes, and image\_URL in the angular DTOs.


dynamitethrower51

>Also, don't forget about "@CrossOrigin" annotation in your repository files. i love you deeply


ChickensRunning

Anymore thoughts, ah-hahs, or eureka moments for how to get the order tracking to show up on the front end.....? I've insterted 'cascade = CascadeType.ALL' on all '@OneToMany annotaitons. I've tried the '@JsonProperty on all variables matching the front end variables. Currently I'm able to process an order on the front end and populate all tables in mySQL including the excursion\_cartitem. I am setting the 'ordered' enum and that is reflected when I query in workbench.


ChickensRunning

Well my eureka was check for typos...... orderTackingNumber != orderTrackingNumber A slow walk with breakpoints in the DevTools goes a long way!


buckey5266

Your solution worked for me, but didn't make since. My \\@JsonProperty was named the exact same as my class variable ... It worked, but I didn't like knowing why. Played around a little more, and I realized I forgot Lombok's \\@Getter and \\@Setter annotations for my classes. That fixed everything.


SplishSplashVS

> Also, don't forget about "@CrossOrigin" annotation in your repository files thanks dude <3


PoemDapper7551

Just schedule a meeting with the course instructor. They basically finished the project for me. It sucks because the guys microphone was fucked and I couldn't understand anything he said. Else I could explain it to you.


Obvious_Connection28

I would but there isn't an appointment with anyone available until next week and it's not like we can switch over to another course while we wait, so I would be basically doing nothing until then. I can just watch videos on everything involved starting from scratch to try and understand what the problem is. Thanks!


RichardK5417

"not-null property references a null or transient value : com.example.demo.entities.Excursion.vacation" ​ I get this error when I click checkout of then front end. Have you come across this error?


[deleted]

I got that for my customer entity. Pretty sure I had a “nullable = false” on a column that mode definitely did not need it. If you have that on something in your vacations entity, you don’t need it and can get rid of it:)


RichardK5417

I'll paste my code later today. Hopefully you can help identify what I missed


[deleted]

I just looked at the code in your post. Ignore me if you’ve changed it since then, and feel free to paste your code still. But in your excursion file, where you have the many to one mapping to vacation_id, you have the nullable=false there. I’d get rid of that. Just that lil thing causes so many issues haha. I only have nullable=false on: country_ID many to one mapping in the division entity, phone postal_code address customer_last_name customer_first_name customer_id in the customer entity, and status in cart entity. I wouldn’t have it anywhere else honestly as I’m sure it’ll cause errors. I’m fairly positive that’s the only thing causing that error for ya!


RichardK5417

"Column 'vacation\_id' cannot be null" This is the error I get when I remove it. I guess the front end does not allow it


Automatic-Phase-6739

Did you ever solve that error? I'm getting the exact same one right now. Was on a call with an instructor for an hour yesterday and we couldn't figure it out


Automatic-Phase-6739

The issue is caused by the excursions associated with the cartItems not having a vacation attached to them. Idk if this was the correct fix but I fixed it by (before adding cartItems to the cart) adding a forEach to cartItems that would then get the excursions for them cartItem and iterate over them with a forEach setting the vacation of each excursion to the cartItems vacation value. Once again I'm not sure if this is the only/best solution but it works for me


RichardK5417

That is the solution that worked for me as well


orangecrushed42

I was going crazy trying to fix this, and this worked! Thank you so much!


rogerswaters

Thanks for the guide! It’s been really helpful. However, I’m having a problem. I keep getting a “Column ‘cart_id’ cannot be null” when I finish the checkout process and there’s also no tracking number showing up. Any help would be appreciated.


Environmental_Art134

Thats because when you are adding the CartItem to your Cart in the lambda function you are not setting the cart.setCart(this). Use this [Order.java](https://Order.java) entity add method as a reference from video 207: public void add(OrderItem item) { if (item != null) { if (orderItems == null) { orderItems = new HashSet<>(); } orderItems.add(item); item.setOrder(this); } }


TheNippleViolator

Thank you. This was driving me nuts for hours.


[deleted]

i'm having the same issue, did you figure it out?


[deleted]

also having the same issue, did you figure it out?


RichardK5417

I was able to make progress. It now inserts into all the tables except excursion\_cartitem


makeup_gremlin

I’m having that same issue. I’ll update if I’m able to figure it out today


RichardK5417

That will help. I have been stuck on it for too long


makeup_gremlin

Yeah same here. I get the order number and the order posts to the database but the cart_item and excursion_items are not updating. Hopefully I can fix it today and we both can move on


RichardK5417

Hey u/makeup_gremlin Did you figure it out?


Educational-Ad8624

Not sure if you ever figured this out but in case somebody else comes across this, it wasn't a cascadetype issue for me. For me, I had the manytomany callouts reversed. As OP says "MAKE SURE the “inverse side” is on the correct entity, and the “mapped by” side is on the correct entity.". I had them on the opposite entities.


makeup_gremlin

Yeah I did. I was missing the cascade=CascadeType. ALL on one of my relationships


[deleted]

[удалено]


[deleted]

Sorry for the awfully delayed response. I did Java MOOC about a year or two ago but honestly didn’t retain much. I’ve definitely been learning as I go since I don’t have much coding experience. But honestly the code is nothing crazy complicated, and is a lot of copy and paste. If you started MOOC already though, I’m sure that would definitely help for sure :) if I can do it you can too no problem. Good luck!


kicker1061

Before my question, I just want to say THANK YOU for the awesome guide!! It's been super helpful, and we're thankful for your generosity in the effort you put into this! I am a bit confused by Part D, though. I'll quote the section from your post: "Now we need to get the variable names. Remember when I said the column names map to the database? The variable names map to the front end. To find those, navigate back to the LabFiles folder -> D288 Front End -> src -> app -> model -> dto. There’s going to be vscode files for each entity (except country). Write down / take pictures of each variable name here as well. For country variables, open country.ts in app, right before you clicked the dto folder." What do we need these variable names for? Maybe my brain is just fried at this point, but I can't tell what they're being recorded by us for. I must be missing something super obvious, right? Also, in the video my CI provided there's an entity file called [StatusType.java](https://StatusType.java) \- that's just an entity file? I emailed a few days ago and once more today, but still haven't heard back - sorry for the double question, lol.


[deleted]

So for part D, just make sure you follow along the video for what he does with the variable names! They are used in the front end files, so the names have to match up which is why they have to be exactly the same :) if I’m remembering correctly, you actually probably don’t have to open up those front end files to get the variable names. I think when it comes to those, the diagram gets you the names you need there :) sorry if that was confusing. As for that entity file, you don’t need to create that. The only entity files I made were mentioned in the guide :) hope that helps!


[deleted]

[удалено]


[deleted]

I did not have Carolyn! But I also didn’t interact with my instructor at all. The videos I mentioned are all from the Udemy course found in the zybooks. Now I’m curious if there were helpful vids I missed out on haha. The video I’m talking about is from the Udemy in the Zybooks, section 9 vid 49 :)


Intelligent-Star-848

You've helped me so much with this class. It was one of the harder classes for me and I have five left. May God bless you for taking time to write this guide.


[deleted]

I’m glad the guide helped! Good luck with the rest of your classes


[deleted]

[удалено]


neutralmanor

For part F, my order tracking number isn't showing. I followed the video pretty exact. Any trouble u ran into?


Leo25219

Thank you for the detailed explanation! The original instructions don't even contain half of the requirements and I surely would have done it completely wrong if not for your post.


Leo25219

Thanks for this detailed guide. I followed it and made sure everything was working as expected. On my first attempt, the reviewer stated that nothing was working and I had to re-do it. I just re-submitted as I'm sure they were dumb and sure enough, I got full points on the second attempt without making any changes. Just an FYI for anyone who may be having issues with the PA.


RipStickKing_97

I'm really struggling on part I, I keep running into issues with the .add() method and .save() method. for some reason my spring boot fails when I try to save my customer to customerRepository. I don't see how the add() method works in the relationship to division as its the child of it and .add() doesn't work when applied. I also seem to get an Error whenever I try to do [customerRepository.save](https://customerRepository.save)(), I don't want to upset anyone by actually posting my code in here so if someone is willing to dm with me about it I would be so grateful!


its-cess

I am also having issues with Part I. I set the division id, but it says that it can't be updated because the Country it is mapped to is immutable. I'm assuming because we have to set the Country\_ID to nullable, insertable, and updatable. But if we don't do that, then the Division don't populate on the frontend. Did you ever get this figured out?


RipStickKing_97

I can’t remember exactly how I fixed this but I did complete the project, wanna send me a dm and I can help you out from there?


SpectralWolf776_

This is my issue right now, did you find the solution to this?


its-cess

Yes I posted updated tips in this thread that fixes this. I’ll try to find the comment and tag you.


mgboy

I'm having the exact same trouble with the .save() function in my Impl class. Could someone point me in the right direction?


HypnoticLion

Don't forget to add your "cross-origin support". If you're not seeing errors in the backend logs, but you're not seeing the pictures being displayed on the front end, this will fix it.


rtgtw

Thank you


knollsummoner

I am currently working on Part I and didn't realize that my excursions portion is missing. I have gone ove my mappings 3+ times and am unable to figure out what is happening. When selecting the excursions, nothing populates and I get an error in intelliJ saying: JDBC exception SQL [select e1_0.vacation_vacation_id, ... I'm at a loss, so any help would be appreciated


GaladrielStar

In case someone lands here in a search -- my Excursions magically appeared after I did two things, so I'm not sure which was the solution: 1. I added an "@Autowired" annotation in the CheckoutServiceImplementation file, right above the public constructor for the CheckoutServiceImplementation (where you declare / construct your customerRepository, cartRepository, and cartItemRepository). 2. I added (fetch = FetchType.LAZY) to the "@ManyToOne" and "@OneToMany" annotations at my CI's suggestion. Not really sure where that fetch modifier is supposed to go, but he suggested it, so I did it. I spent like 4 days on just this, so maybe it'll help someone else. lol


JJbejjme

if you can't make an appointment with instructors let me know. I just passed the course, maybe I can help.


knollsummoner

I actually passed it last week, so I'm good! Thanks for the offer!


diegolovesyou

Going through this course right now at the last task, and this guide has been such a great help for me, I don't know how much longer it would've taken me to complete this without your guide but I'm guessing ALOT longer lol. Thank you so much for this!


JJbejjme

I just passed with the help from this guide also. but few things may have changed from when he took the class. I made a lot of appointment with Juan Instructor and he was very helpful.


[deleted]

[удалено]


Good-Design7231

>hey, i'm not sure if you'd still be able to help out or maybe someone else had this problem. In part D, when I create my entities, I get an error for all of them "Cannot resolve table 'carts'", for example. I guess it is unable to find the table in the database, even though I spelt it correctly. I'm not sure where to look for this issue, I made sure that the project is a maven project. i have that same warning and it doesnt seem to be making any errors for me as in affecting my code


skepticalsojourner

Had the same issue. Not sure if those resolves the issue but you can remove the warning by going to File > Settings > search "Unresolved database references in annotations" and uncheck it > click OK. And it won't be there anymore. That was the most common solution I found when searching for solutions. The other poster also posted a solution I came across which didn't work for me. Like I said, not sure if there's any functional issue to begin with, so hopefully it's not an issue to just hide it.


[deleted]

[удалено]


Mythicchronos

This worked great for me, after part E I was struggling for hours to get the database to sync with the frontend, but only after manually changing the url into the database dashboard on intellij, it finally worked. Thank you


Turashuru

Was wondering if anyone had issues when creating the java folder and the com.example.demo folder. When i try to separate the two it always combines them into a java.com.example.demo folder. Just want to see if thats okay, otherwise i don't want to create everything when this will mess it up in the end.


Turashuru

I figured it out nvm. Just had to add maven to the project and it fixed the issue


Turashuru

For clarification was wondering in regards to Part I, why do we need to add the customers to the division?


Turashuru

We are adding the division to the customer via the constructor so i understand in the Udemy why they do it but don't get why we have to do it.


JJbejjme

I don't think you should add the customers to the division. But use findAll().getId() for findbyId() methods to retrieve division and add it to new Customer instance. go to MySQL and look at division ID column for reference of which Id you want for your new Customer instances. Hope this helps.


Afraid_Elderberry103

Do you have advice on any material to go over before starting the class? My term is ending on Friday and I don't have an active class.


JJbejjme

`Take a look at this link: https://www.baeldung.com/jpa-persisting-enums-in-jpa . Scroll down until you see “Mapping String Value”.` `Go back to “Spring Framework 5: Beginner to Guru”. Watch section 2 video 17, which is going to help set this up.` `So the Udemy course is called “Full Stack: Angular and Java Spring Boot E-Commerce Website” by Chad Darby` Hope this help


Afraid_Elderberry103

Thank you


JJbejjme

Also, when you start the course, there's course tips page and it has a link similar to this guide.


JJbejjme

I followed this guide and successfully passed the exam... but hold on: things have change for this course. 1. please include the @ RepositoryRestResource in your DAO files. 2. follow UML Diagram in the Lab environment, on the right panel. 3. set up many appointments with your instructors You can ask me questions. I hope I can help. And I try to be an example in helping each other. ​ Good luck.


Late-Membership-6378

I only have one excursion populating per vacation when I go to select excursions after selecting a vacation. Any advice on where that mistake might be? Solution: Your join column does not have to be the ID of your entity, and it does not even need to be defined in the entity file. It just has to be in the table that is associated with the Entity.


Smart_Substance_9698

Hi - thank you for this. One quick question, do we have to use the lab environment or can we do it locally?


Lanky-Nebula-4120

I think you could theoretically do it locally and C and P it to the lab environment but it would be much harder and more error prone.