Roel De Nijs wrote:
Sreyan Chakravarty wrote:Is it part of JPA or Hibernate specifically ?
If you have a look at the JPA package sumary, you'll see no mention of ForceDiscriminator so it's Hbernate specific.
Roel De Nijs wrote:I think this article describes pretty well why you need to use the @ForceDiscriminator annotation.
A.J. Côté wrote:Strange... How can you tell that your constraints are inherited if export schema fails?
Kai Prünte wrote:IMO this is a bug in Hibernate 5.
I have the same issue in Hibernate 5.0.1. The same code with Hibernate 4.x works fine.
A.J. Côté wrote:Hello,
I do not think it is a bug. Since you have no common table, you would need to define the constraint in every subclass table. I don't think constraints can be inherited.
Consider using InheritanceType.JOINED or even InheritanceType.SINGLE_TABLE if you want to declare the constraint only once for all your subclasses.
That is my understanding but I haven't investigated in depth.
Roel De Nijs wrote:
Sreyan Chakravarty wrote:Now it says basically to model the Join Table as a separate entity by decomposing all the many-to-many relationships into one-to-many and many-to-one relationships. Now my question is that - doesn't this decomposing into one-to-many and many-to-one destroy the conceptual mapping of many-to-many ?
I mean is one-to-many and many-to-one really the same thing ? Doesn't that destroy the original data model ?
If you don't need additional columns, you can use the @ManyToMany annotation. But if you need additional columns and it seems your data model requires them, so as far as I know there's no other solution than the one described in the link I provided. I don't see any problem with this approach.
Roel De Nijs wrote:
Sreyan Chakravarty wrote:Now one subject can be studied by many students and one student can study many subjects. So its a many to many relationship. Correct me if I am wrong.
You are correct!
Sreyan Chakravarty wrote:Now there can be multiple internal exams that a Student might have to take, thus the number of internals are not fixed, hence internal_no.
For each Subject there are an undefined number of internal exams. So for subject A there could be just one exam, but for subject B there are 5 exams.
So you could have an Exam table { exam_id, internal_no, subject_id } and then the Marks table would be something like { student_id, exam_id, marks }. But that would require an extra join each time you want to query the marks, for example on a specific subject for all students (or one specific student).
Sreyan Chakravarty wrote:Now what is confusing me is this. If Student and Subjects share a many to many relationship then what relationship should hold in the marks table ? Since both Student_id and Subject_id are referenced from Student and Subject table respectively.
You'll need a JoinTable with additional columns. And table Marks will be this join table; Student_id, Subject_id, internal_no will be the composite primary key; and the marks column will be the additional column.
Tim Holloway wrote:The easiest way is with an IDE. Import the Tomcat source code in as a project, run the Tomcat build scripts, configure the resulting copy of Tomcat like you were doing with the prebuilt copy, then launch it using the IDE's "Remote Application" debugging feature. Set breakpoints as desired.
Tim Holloway wrote:One of the problems with getting free support is that unless it's something I already know or can easily pull out of docs from the same sources as you can, it's too much work for me to do for free.
Unfortunately, this is one of those cases. I normally use the common MD5 encryption, and that's handled by the default mechanisms, so I have had no need to learn the more obscure options.
I can tell you that if my employer required that I go the more complex route that I'd pull the Tomcat source code, do a build and put a breakpoint on the failing instruction to try and see where things were wrong - assuming that I had what I thought were the correct parameters. If you want to try doing that yourself, I can help you in setting up a debugging environment. Actually making sense of it would be mostly up to you.
Tim Holloway wrote:This may be related to your other question. Apparently your Realm is not configured properly, as the "stored credentials" are null instead of a parseable String potentially containing a "$". Or so says the source code for the failing logic.
The "login-error-page" is displayed when login fails because of improper credentials from the user. The "500 Error" page occurs when the credentials could not be compared because of a program logic fault.
In all the years I've worked with Tomcat, I don't think I've ever had the "500" page display on login. The Realm modules aren't expected to fail under proper configuration settings.