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

Moderator: admin

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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?

admin
Site Admin
Posts: 8907
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Did you read the explanation provided with this option?
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

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

Post 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).

admin
Site Admin
Posts: 8907
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests