Support for type(entity) in JPA #102

Closed
timowest opened this Issue Feb 23, 2012 · 3 comments

Comments

Projects
None yet
1 participant
@timowest
Member

timowest commented Feb 23, 2012

Support for type(entity) in JPA

This can be utilized for example in sorting etc.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 23, 2012

Member

Add to JPQLGrammar

Member

timowest commented Feb 23, 2012

Add to JPQLGrammar

timowest added a commit that referenced this issue Feb 23, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 26, 2012

Member

I added the following method to JPQLGrammar which can be used for ordering on type

public static StringExpression type(EntityPath<?> path) {
    return StringOperation.create(JPQLTemplates.TYPE, path);
}

It is String typed, because with the Class type a ComparableExpression could not be constructed, and because type(alias) is mapped to alias.class for Hibernate which is String typed.

Member

timowest commented Feb 26, 2012

I added the following method to JPQLGrammar which can be used for ordering on type

public static StringExpression type(EntityPath<?> path) {
    return StringOperation.create(JPQLTemplates.TYPE, path);
}

It is String typed, because with the Class type a ComparableExpression could not be constructed, and because type(alias) is mapped to alias.class for Hibernate which is String typed.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Mar 11, 2012

Member

released in 2.3.3

Member

timowest commented Mar 11, 2012

released in 2.3.3

@timowest timowest closed this Mar 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment