You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Sven Haag (Jira)" <ji...@apache.org> on 2022/02/18 08:02:00 UTC

[jira] [Updated] (DELTASPIKE-1447) EntityRepository does not support OrderBy for Nested Properties

     [ https://issues.apache.org/jira/browse/DELTASPIKE-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Haag updated DELTASPIKE-1447:
----------------------------------
    Description: 
The orderBy query referencing a nested property of an embedded type does not work. It returns the results, but unsorted!

 
{code:java}
@Entity(name = "foo")
public class FooEntity {
    @Id @GeneratedValue
    private UUID id;

    @Embedded
    private final MyEmbedded myEmbedded = new MyEmbedded();
}{code}
{code:java}
@Repository(forEntity = FooEntity.class)
public interface FooRepository extends EntityRepository<FooEntity, UUID> {

    List<FooEntity> findAllOrderByMyEmbedded_CreatedOnDesc();
}{code}

  was:
The orderBy query referencing a nested property of an embedded type does not work.

 
{code:java}
@Entity(name = "foo")
public class FooEntity {
    @Id @GeneratedValue
    private UUID id;

    @Embedded
    private final MyEmbedded myEmbedded = new MyEmbedded();
}{code}
{code:java}
@Repository(forEntity = FooEntity.class)
public interface FooRepository extends EntityRepository<FooEntity, UUID> {

    List<FooEntity> findAllOrderByMyEmbedded_CreatedOnDesc();
}{code}


> EntityRepository does not support OrderBy for Nested Properties
> ---------------------------------------------------------------
>
>                 Key: DELTASPIKE-1447
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1447
>             Project: DeltaSpike
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Data-Module
>    Affects Versions: 1.9.5
>            Reporter: Sven Haag
>            Priority: Major
>              Labels: embedded, nested, orderby
>
> The orderBy query referencing a nested property of an embedded type does not work. It returns the results, but unsorted!
>  
> {code:java}
> @Entity(name = "foo")
> public class FooEntity {
>     @Id @GeneratedValue
>     private UUID id;
>     @Embedded
>     private final MyEmbedded myEmbedded = new MyEmbedded();
> }{code}
> {code:java}
> @Repository(forEntity = FooEntity.class)
> public interface FooRepository extends EntityRepository<FooEntity, UUID> {
>     List<FooEntity> findAllOrderByMyEmbedded_CreatedOnDesc();
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)