Page 1 of 1

About Question enthuware.oce-jpad.v6.2.428 :

Posted: Sun Jun 25, 2017 2:05 pm
by himaiMinh
Hi, everyone,
I think the correct option can include this : "the actual position of an element in a collection annotated with @OrderColumn can be found by accessing a property of the element".

Like the explanation says " OrderColumn is used to preserved order of elements in which they were added in a collection".

For example, the first element in that collection corresponds to 1 in the order column in the table, the second element corresponds to 2 in the order column and etc.

I may interpret this statement incorrectly.
Any comments?

Re: About Question enthuware.oce-jpad.v6.2.428 :

Posted: Tue Jun 27, 2017 10:13 pm
by admin
Did you read the explanation provided with this option?

Re: About Question enthuware.oce-jpad.v6.2.428 :

Posted: Mon Jul 03, 2017 1:10 pm
by himaiMinh
I guess I misunderstand the option. If we use a list iterator to iterate each element in the list (the collection annotated with @OrderColumn) , we can find the actual position of the elements, which is consistent with the order in OrderColumn.

Re: About Question enthuware.oce-jpad.v6.2.428 :

Posted: Fri Aug 11, 2017 9:36 am
by himaiMinh
In the last explanation about @OrderColumn, it says "if the name is not specified , the column name is....
In the example given above, the name would be LINEITEM_ORDER".
I think this example, the default order column name is LINEITEMS_ORDER.

Because the rule says "the name of the referencing relationship property or fields of the referencing entity or embeddable class...."
And the name of the referencing relationship property of field is lineItems, not lineItem.

Re: About Question enthuware.oce-jpad.v6.2.428 :

Posted: Sun Sep 16, 2018 10:10 pm
by __JJ__
himaiMinh wrote:
Fri Aug 11, 2017 9:36 am
In the last explanation about @OrderColumn, it says "if the name is not specified , the column name is....
In the example given above, the name would be LINEITEM_ORDER".
I think this example, the default order column name is LINEITEMS_ORDER.

Because the rule says "the name of the referencing relationship property or fields of the referencing entity or embeddable class...."
And the name of the referencing relationship property of field is lineItems, not lineItem.
Yes this is true. I also spotted that and tested it and can confirm that fieldname_ORDER is the default name of the column, so in this case it is lineItems_ORDER (at least, on MySQL, the case is preserved by default).

Re: About Question enthuware.oce-jpad.v6.2.428 :

Posted: Sun Sep 16, 2018 11:17 pm
by admin
Fixed.
thank you for your feedback!