Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » OrderColumn not respected in fetch of unidirectional OneToMan
OrderColumn not respected in fetch of unidirectional OneToMan [message #1783698] Thu, 15 March 2018 17:08 Go to next message
Andreas Loewen is currently offline Andreas LoewenFriend
Messages: 1
Registered: March 2018
Junior Member
Hi all,

I have a strange problem with Eclipselink in Netbeans 8.2/Glassfish 4.1.
The OrderColumn is not respected in fetch operation with an unidirectional OneToMany Relation. Funny thing though: The OrderColumn is set and updated correctly. There is just no "ORDER BY ..." part on the created Query.
I have tried several Versions of Eclipselink, including 2.6.2 and 2.7.1.


public abstract class ShopUser extends LongIdTimestampedEntity implements LongIdComparable<ShopUser> {

    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch=FetchType.LAZY)
    @OrderColumn
    private List<Telefonnummer> telefon = new LinkedList<>();
...


@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(length = 8)
@DiscriminatorValue("0")
public class Telefonnummer extends LongIdEntity {
...
}


@MappedSuperclass
@TableGenerator(name = "generalId", initialValue = 0, allocationSize = 10)
public abstract class LongIdEntity implements Serializable {

    private static final long serialVersionUID = 0L;

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "generalId")
    private Long id;
    @Version
    private long version = 0;
...
}


Any Ideas?
Re: OrderColumn not respected in fetch of unidirectional OneToMan [message #1784018 is a reply to message #1783698] Wed, 21 March 2018 15:06 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
I would suspect it has to do with inheritance. Can you post the query that is used, and details regarding any subclasses?

Regards,
Chris
Previous Topic:Attribute Converter not working properly on lists
Next Topic:Problem persisting TimestampTZ with JPA
Goto Forum:
  


Current Time: Thu Apr 25 10:50:56 GMT 2024

Powered by FUDForum. Page generated in 0.03080 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top