-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE 864 Fix primitive id field RSQL filter (#866)
* ISSUE 864 Fix primitive id field RSQL filter remove files * Update RSQLFilterDialectTest.java
- Loading branch information
1 parent
0f354bd
commit 0442484
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
elide-core/src/main/java/com/yahoo/elide/utils/TypeHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2019, Oath Inc. | ||
* Licensed under the Apache License, Version 2.0 | ||
* See LICENSE file in project root for terms. | ||
*/ | ||
|
||
package com.yahoo.elide.utils; | ||
|
||
import com.google.common.collect.Sets; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Utilities for checking classes and primitive types. | ||
*/ | ||
public class TypeHelper { | ||
private static final Set<Class<?>> PRIMITIVE_NUMBER_TYPES = Sets | ||
.newHashSet(short.class, int.class, long.class, float.class, double.class); | ||
|
||
/** | ||
* Determine whether a type is primitive number type | ||
* | ||
* @param type type to check | ||
* @return True is the type is primitive number type | ||
*/ | ||
public static boolean isPrimitiveNumberType(Class<?> type) { | ||
return PRIMITIVE_NUMBER_TYPES.contains(type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2015, Yahoo Inc. | ||
* Licensed under the Apache License, Version 2.0 | ||
* See LICENSE file in project root for terms. | ||
*/ | ||
package example; | ||
|
||
import com.yahoo.elide.annotation.Include; | ||
import lombok.Data; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
|
||
|
||
@Include(rootLevel = true, type = "primitiveTypeId") | ||
@Entity | ||
@Data | ||
public class PrimitiveId { | ||
|
||
@Id | ||
private long primitiveId; | ||
} |