.. (לתיקייה המכילה) | ||
After we installed everything and tried to run the example.java file, it didn't compile saying it doesn't recognize the import: | |
You should work with JDK 8, as opposed to JDK 10-12 with which you are probably working. |
What does it mean that every new Mimouna celebration guests counter is initialized to 0 and | |
It means that your Mimounas table should have a default constraint on these columns and that in addMimouna(Mimouna M) you should ignore M's corresponding fields' values. For example, if addMimouna is being called with a Mimouna M that satisfies M.guestCount=150 and M.isPoliticianComing=true, the values the table holds after inserting the record should be 0 and false respectively. |
Should we check whether the input to a function isn't NULL? | |
No. You can assume that NULL values won't be provided as input to any function. However, there could be NULL String fields in a given object. |
In deleteUser (and in other delete functions), how should we check whether the user we wish to delete exists? | |
The proper way to check it is by checking the value returned from pstmt.executeUpdate(). It returns the number of affected rows in the DB. In case it returns 0 you can conclude that the user wasn't in the DB and return NOT_EXISTS |
Should the field username of User be a foreign key in Mimouna? | |
No. |
What is considered "Java" and what is considered "SQL commands"? | |
Any comparison or any calculation performed on the data out of an SQL command is considered Java. NOTE: The only exception to this rule of thumb is checking the number of results returned from executeUpdate and parsing executeQuery. |
When deleting User/Mimouna/Mimounalist, should we allow deletions based on Id only or based on other fields as well? | |
Only by Id. |
If there is a "bad" input that can result in more than one error (e.g ALREADY_EXISTS and BAD_PARAMS), what should be returned? | |
The return values priorities are as written in the pdf from top to bottom. |
What if addMimouna(Mimouna M) is called and M.guestCount is negative? should we return BAD_PARAMS? | |
No. M.guestCount is irrelevant because of the default constraint that your Mimounas table satisfies. |
Should the username value of Mimouna be a foreign key of User? | |
No |
If there is a "bad" input that can result in more than one error (e.g. ALREADY_EXISTS and BAD_PARAMS), | |
The return values' priorities are in the same order as written in the PDF, from top to bottom. In every function, BAD_PARAMS is the least prioritized return value. |
When inserting User/Mimouna/Mimounalist, if an object with the same ID already exists | |
same id = same object when trying to insert to a table, even if it differs in other fields. |
Who are the close users of a user who doesn't follow any Mimounalist? | |
Nobody, in case that a user follows 0 Mimounalists, getCloseUsers should return an empty arrayList. In this case, getMimounaListRecommendation should return an empty arrayList as well. |
Can a user be a "closer user", i.e. if user 2 follows 0.7*lists that are mutual with user 1 | |
No. |
Can we use a function (such as getUserProfile) within another function? | |
No |
In getMostPopularMimounaList, if there are no MimounaLists, | |
You should return 0 |
We noticed a little difference between the classes and the basic tests (setFamilyname instead of setFamilyName), | |
Change it to setFamilyName. The updated zip is uploaded (the only change in the most updated zip is this particular issue) |
in getMostPopularMimounaList, if there are MimounaLists but they are all empty, what should we return? | |
The highest Id among all Mimounalists |
In closeUsers, how should we calculate 67%? | |
User 2 is considered a close user of user 1 if it meets the following condition: A close user will be calculated as follows: num_of_mutual_lists_of_both_users >= 0.67 * num_of_lists_user_1_follows |
Is it true that we must draw an ERD? | |
No, but I do expect you to draw a scheme of your tables and views, explain what you did and why. In addition, explain the logic behind every function, what queries you used and why. |
If there is a politician that comes to a Mimouna and confirmAttendancePoliticianToMimouna | |
return BAD_PARAMS (that is true for every case that confirmAttendancePoliticianToMimouna is being called with userId that is not a politician. |
What is the meaning of: "It is forbidden to use java code"? | |
You are not allowed to use any getter of User/Mimouna/MimounaList in order to check values. For example, it is forbidden to check in the start of a function whether there are bad parameters in the following way: if(mimouna.getUserName() == null) return BAD_PARAMS; In fact, every function that includes a comparison of a getter is probably forbidden. instead, use SQL queries to check that (usually you can "catch" all BAD_PARAMS cases in one main query that also includes the whole logic of the function, an EXCEPTION to it is confirmAttendencePoliticianToMimouna where 2 queries are required. I will say that it is possible to do it in one query using a few simple views. |