Select key from jsonb postgreSQL using Hibernate Criteria query in JavaJPA and Hibernate - Criteria vs. JPQL or HQLHow do I call one constructor from another in Java?How do I create a Java string from the contents of a file?How to get an enum value from a string value in Java?Wrong ordering in generated table in jpaSave PL/pgSQL output from PostgreSQL to a CSV filehow to select value from database using hibernate?want to add two different tables(classes) in one hibernate criteriaHow to exit from PostgreSQL command line utility: psqlExplanation of JSONB introduced by PostgreSQL
Create less file for custom Theme
How is CoreiX like Corei5, i7 is related to Haswell, Ivy Bridge?
Further factorisation of a difference of cubes?
How are one-time password generators like Google Authenticator different from having two passwords?
How do I compare the result of "1d20+x, with advantage" to "1d20+y, without advantage", assuming x < y?
Are there variations of the regular runtimes of the Big-O-Notation?
Company threw a surprise party for the CEO, 3 weeks later management says we have to pay for it, do I have to?
Why can't I prove summation identities without guessing?
Is a vertical stabiliser needed for straight line flight in a glider?
Early arrival in Australia, early check in not available
Passport stamps art, can it be done?
Why do unstable nuclei form?
Can more than one creature benefit from multiple Hunter's Mark spells cast on the same target?
Thesis' "Future Work" section – is it acceptable to omit personal involvement in a mentioned project?
Remove color cast in darktable?
Why are low spin tetrahedral complexes so rare?
Why are parallelograms defined as quadrilaterals? What term would encompass polygons with greater than two parallel pairs?
What is the name of meteoroids which hit Moon, Mars, or pretty much anything that isn’t the Earth?
Two researchers want to work on the same extension to my paper. Who to help?
Can 'sudo apt-get remove [write]' destroy my Ubuntu?
Is there any evidence to support the claim that the United States was "suckered into WW1" by Zionists, made by Benjamin Freedman in his 1961 speech
What does formal training in a field mean?
How to slow yourself down (for playing nice with others)
Is it a Munchausen Number?
Select key from jsonb postgreSQL using Hibernate Criteria query in Java
JPA and Hibernate - Criteria vs. JPQL or HQLHow do I call one constructor from another in Java?How do I create a Java string from the contents of a file?How to get an enum value from a string value in Java?Wrong ordering in generated table in jpaSave PL/pgSQL output from PostgreSQL to a CSV filehow to select value from database using hibernate?want to add two different tables(classes) in one hibernate criteriaHow to exit from PostgreSQL command line utility: psqlExplanation of JSONB introduced by PostgreSQL
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am writing the criteria query to get results for jsonb in postgres.I can query the jsonb column through hibernate.I am unable to fetch jsonb specific keys.I am not able to find a way.
I have tried native query but i want some wayout in hibernate criteria query.The commonjson argument is the jsonb in postgresql is this --
"appl_id": 726516, "applied_by": "pankajkumarnnl94@gmail.com", "service_id": 9880004, "version_no": 4, "appl_ref_no": "BSEH/2018/00728", "sub_version": 1, "payment_date": "2018-12-04T11:54:20.24+05:30", "payment_mode": "PayUbizz", "reference_no": "7726929249", "service_name": "Migration Certificate Board of School Education Haryana, Bhiwani", "department_id": 784, "location_value": 1218758, "base_service_id": 988, "department_name": " Board of School Education Haryana", "registration_id": "", "submission_date": "2018-12-04", "submission_mode": "online", "no_of_attachment": 2, "submission_location": "1578947~1218758~Board of School Education Haryana"
Model Class ->ApplInfoJson
package com.saral.reporting.model;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name = "r_app_json",schema="saral1", catalog="saral1")
public class ApplInfoJson
@Id
@Column(name = "aid")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long aid;
@Column(name = "id")
private Long id;
@JsonProperty("appl_info")
@Column(name = "appl_info")
private String applInfo;
@Column(name = "application_form_attributes")
private String applicationFormAttributes;
@Column(name = "enclosure_data")
private String enclosureData;
@Column(name = "service_id")
private Long serviceId;
@Column(name = "combined_json")
@Type(type = "JsonDataUserType")
private Map<String , Object> combinedJson;
@Column(name ="location_value")
private Long locationValue;
public Long getLocationValue()
return locationValue;
public void setLocationValue(Long locationValue)
this.locationValue = locationValue;
public Long getServiceId()
return serviceId;
public void setServiceId(Long serviceId)
this.serviceId = serviceId;
public Long getAid()
return aid;
public void setAid(Long aid)
this.aid = aid;
public Long getId()
return id;
public void setId(Long id)
this.id = id;
public String getApplInfo()
return applInfo;
public void setApplInfo(String applInfo)
this.applInfo = applInfo;
public String getApplicationFormAttributes()
return applicationFormAttributes;
public void setApplicationFormAttributes(String applicationFormAttributes)
this.applicationFormAttributes = applicationFormAttributes;
public String getEnclosureData()
return enclosureData;
public void setEnclosureData(String enclosureData)
this.enclosureData = enclosureData;
public Map<String, Object> getCombinedJson()
return combinedJson;
public void setCombinedJson(Map<String, Object> combinedJson)
this.combinedJson = combinedJson;
@Override
public String toString()
return "ApplInfoJson [aid=" + aid + ", id=" + id + ", applInfo=" + applInfo + ", applicationFormAttributes="
+ applicationFormAttributes + ", enclosureData=" + enclosureData + ", serviceId=" + serviceId
+ ", combinedJson=" + combinedJson + ", locationValue=" + locationValue + "]";
Function Used->
public List<ApplInfoJson> findByCombinedJson(String commonJson)
DetachedCriteria criteria = DetachedCriteria.forClass(ApplInfoJson.class);
List<ApplInfoJson> results = (List<ApplInfoJson>) getHibernateTemplate().findByCriteria(criteria);
return results;
I want some thing to pass key name and get data with specific key.
java json postgresql hibernate hibernate-criteria
add a comment |
I am writing the criteria query to get results for jsonb in postgres.I can query the jsonb column through hibernate.I am unable to fetch jsonb specific keys.I am not able to find a way.
I have tried native query but i want some wayout in hibernate criteria query.The commonjson argument is the jsonb in postgresql is this --
"appl_id": 726516, "applied_by": "pankajkumarnnl94@gmail.com", "service_id": 9880004, "version_no": 4, "appl_ref_no": "BSEH/2018/00728", "sub_version": 1, "payment_date": "2018-12-04T11:54:20.24+05:30", "payment_mode": "PayUbizz", "reference_no": "7726929249", "service_name": "Migration Certificate Board of School Education Haryana, Bhiwani", "department_id": 784, "location_value": 1218758, "base_service_id": 988, "department_name": " Board of School Education Haryana", "registration_id": "", "submission_date": "2018-12-04", "submission_mode": "online", "no_of_attachment": 2, "submission_location": "1578947~1218758~Board of School Education Haryana"
Model Class ->ApplInfoJson
package com.saral.reporting.model;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name = "r_app_json",schema="saral1", catalog="saral1")
public class ApplInfoJson
@Id
@Column(name = "aid")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long aid;
@Column(name = "id")
private Long id;
@JsonProperty("appl_info")
@Column(name = "appl_info")
private String applInfo;
@Column(name = "application_form_attributes")
private String applicationFormAttributes;
@Column(name = "enclosure_data")
private String enclosureData;
@Column(name = "service_id")
private Long serviceId;
@Column(name = "combined_json")
@Type(type = "JsonDataUserType")
private Map<String , Object> combinedJson;
@Column(name ="location_value")
private Long locationValue;
public Long getLocationValue()
return locationValue;
public void setLocationValue(Long locationValue)
this.locationValue = locationValue;
public Long getServiceId()
return serviceId;
public void setServiceId(Long serviceId)
this.serviceId = serviceId;
public Long getAid()
return aid;
public void setAid(Long aid)
this.aid = aid;
public Long getId()
return id;
public void setId(Long id)
this.id = id;
public String getApplInfo()
return applInfo;
public void setApplInfo(String applInfo)
this.applInfo = applInfo;
public String getApplicationFormAttributes()
return applicationFormAttributes;
public void setApplicationFormAttributes(String applicationFormAttributes)
this.applicationFormAttributes = applicationFormAttributes;
public String getEnclosureData()
return enclosureData;
public void setEnclosureData(String enclosureData)
this.enclosureData = enclosureData;
public Map<String, Object> getCombinedJson()
return combinedJson;
public void setCombinedJson(Map<String, Object> combinedJson)
this.combinedJson = combinedJson;
@Override
public String toString()
return "ApplInfoJson [aid=" + aid + ", id=" + id + ", applInfo=" + applInfo + ", applicationFormAttributes="
+ applicationFormAttributes + ", enclosureData=" + enclosureData + ", serviceId=" + serviceId
+ ", combinedJson=" + combinedJson + ", locationValue=" + locationValue + "]";
Function Used->
public List<ApplInfoJson> findByCombinedJson(String commonJson)
DetachedCriteria criteria = DetachedCriteria.forClass(ApplInfoJson.class);
List<ApplInfoJson> results = (List<ApplInfoJson>) getHibernateTemplate().findByCriteria(criteria);
return results;
I want some thing to pass key name and get data with specific key.
java json postgresql hibernate hibernate-criteria
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
Use the standardCriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…
– Ancoron
Mar 25 at 5:53
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
You need to use functionjson_extract_path_text(combined_json, 'appl_info')
(assuming that columncombined_json
contains the JSON. Translated into Criteria Query, this means something like:cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13
add a comment |
I am writing the criteria query to get results for jsonb in postgres.I can query the jsonb column through hibernate.I am unable to fetch jsonb specific keys.I am not able to find a way.
I have tried native query but i want some wayout in hibernate criteria query.The commonjson argument is the jsonb in postgresql is this --
"appl_id": 726516, "applied_by": "pankajkumarnnl94@gmail.com", "service_id": 9880004, "version_no": 4, "appl_ref_no": "BSEH/2018/00728", "sub_version": 1, "payment_date": "2018-12-04T11:54:20.24+05:30", "payment_mode": "PayUbizz", "reference_no": "7726929249", "service_name": "Migration Certificate Board of School Education Haryana, Bhiwani", "department_id": 784, "location_value": 1218758, "base_service_id": 988, "department_name": " Board of School Education Haryana", "registration_id": "", "submission_date": "2018-12-04", "submission_mode": "online", "no_of_attachment": 2, "submission_location": "1578947~1218758~Board of School Education Haryana"
Model Class ->ApplInfoJson
package com.saral.reporting.model;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name = "r_app_json",schema="saral1", catalog="saral1")
public class ApplInfoJson
@Id
@Column(name = "aid")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long aid;
@Column(name = "id")
private Long id;
@JsonProperty("appl_info")
@Column(name = "appl_info")
private String applInfo;
@Column(name = "application_form_attributes")
private String applicationFormAttributes;
@Column(name = "enclosure_data")
private String enclosureData;
@Column(name = "service_id")
private Long serviceId;
@Column(name = "combined_json")
@Type(type = "JsonDataUserType")
private Map<String , Object> combinedJson;
@Column(name ="location_value")
private Long locationValue;
public Long getLocationValue()
return locationValue;
public void setLocationValue(Long locationValue)
this.locationValue = locationValue;
public Long getServiceId()
return serviceId;
public void setServiceId(Long serviceId)
this.serviceId = serviceId;
public Long getAid()
return aid;
public void setAid(Long aid)
this.aid = aid;
public Long getId()
return id;
public void setId(Long id)
this.id = id;
public String getApplInfo()
return applInfo;
public void setApplInfo(String applInfo)
this.applInfo = applInfo;
public String getApplicationFormAttributes()
return applicationFormAttributes;
public void setApplicationFormAttributes(String applicationFormAttributes)
this.applicationFormAttributes = applicationFormAttributes;
public String getEnclosureData()
return enclosureData;
public void setEnclosureData(String enclosureData)
this.enclosureData = enclosureData;
public Map<String, Object> getCombinedJson()
return combinedJson;
public void setCombinedJson(Map<String, Object> combinedJson)
this.combinedJson = combinedJson;
@Override
public String toString()
return "ApplInfoJson [aid=" + aid + ", id=" + id + ", applInfo=" + applInfo + ", applicationFormAttributes="
+ applicationFormAttributes + ", enclosureData=" + enclosureData + ", serviceId=" + serviceId
+ ", combinedJson=" + combinedJson + ", locationValue=" + locationValue + "]";
Function Used->
public List<ApplInfoJson> findByCombinedJson(String commonJson)
DetachedCriteria criteria = DetachedCriteria.forClass(ApplInfoJson.class);
List<ApplInfoJson> results = (List<ApplInfoJson>) getHibernateTemplate().findByCriteria(criteria);
return results;
I want some thing to pass key name and get data with specific key.
java json postgresql hibernate hibernate-criteria
I am writing the criteria query to get results for jsonb in postgres.I can query the jsonb column through hibernate.I am unable to fetch jsonb specific keys.I am not able to find a way.
I have tried native query but i want some wayout in hibernate criteria query.The commonjson argument is the jsonb in postgresql is this --
"appl_id": 726516, "applied_by": "pankajkumarnnl94@gmail.com", "service_id": 9880004, "version_no": 4, "appl_ref_no": "BSEH/2018/00728", "sub_version": 1, "payment_date": "2018-12-04T11:54:20.24+05:30", "payment_mode": "PayUbizz", "reference_no": "7726929249", "service_name": "Migration Certificate Board of School Education Haryana, Bhiwani", "department_id": 784, "location_value": 1218758, "base_service_id": 988, "department_name": " Board of School Education Haryana", "registration_id": "", "submission_date": "2018-12-04", "submission_mode": "online", "no_of_attachment": 2, "submission_location": "1578947~1218758~Board of School Education Haryana"
Model Class ->ApplInfoJson
package com.saral.reporting.model;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name = "r_app_json",schema="saral1", catalog="saral1")
public class ApplInfoJson
@Id
@Column(name = "aid")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long aid;
@Column(name = "id")
private Long id;
@JsonProperty("appl_info")
@Column(name = "appl_info")
private String applInfo;
@Column(name = "application_form_attributes")
private String applicationFormAttributes;
@Column(name = "enclosure_data")
private String enclosureData;
@Column(name = "service_id")
private Long serviceId;
@Column(name = "combined_json")
@Type(type = "JsonDataUserType")
private Map<String , Object> combinedJson;
@Column(name ="location_value")
private Long locationValue;
public Long getLocationValue()
return locationValue;
public void setLocationValue(Long locationValue)
this.locationValue = locationValue;
public Long getServiceId()
return serviceId;
public void setServiceId(Long serviceId)
this.serviceId = serviceId;
public Long getAid()
return aid;
public void setAid(Long aid)
this.aid = aid;
public Long getId()
return id;
public void setId(Long id)
this.id = id;
public String getApplInfo()
return applInfo;
public void setApplInfo(String applInfo)
this.applInfo = applInfo;
public String getApplicationFormAttributes()
return applicationFormAttributes;
public void setApplicationFormAttributes(String applicationFormAttributes)
this.applicationFormAttributes = applicationFormAttributes;
public String getEnclosureData()
return enclosureData;
public void setEnclosureData(String enclosureData)
this.enclosureData = enclosureData;
public Map<String, Object> getCombinedJson()
return combinedJson;
public void setCombinedJson(Map<String, Object> combinedJson)
this.combinedJson = combinedJson;
@Override
public String toString()
return "ApplInfoJson [aid=" + aid + ", id=" + id + ", applInfo=" + applInfo + ", applicationFormAttributes="
+ applicationFormAttributes + ", enclosureData=" + enclosureData + ", serviceId=" + serviceId
+ ", combinedJson=" + combinedJson + ", locationValue=" + locationValue + "]";
Function Used->
public List<ApplInfoJson> findByCombinedJson(String commonJson)
DetachedCriteria criteria = DetachedCriteria.forClass(ApplInfoJson.class);
List<ApplInfoJson> results = (List<ApplInfoJson>) getHibernateTemplate().findByCriteria(criteria);
return results;
I want some thing to pass key name and get data with specific key.
java json postgresql hibernate hibernate-criteria
java json postgresql hibernate hibernate-criteria
edited Mar 28 at 9:30
shanu dua
asked Mar 23 at 10:01
shanu duashanu dua
113
113
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
Use the standardCriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…
– Ancoron
Mar 25 at 5:53
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
You need to use functionjson_extract_path_text(combined_json, 'appl_info')
(assuming that columncombined_json
contains the JSON. Translated into Criteria Query, this means something like:cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13
add a comment |
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
Use the standardCriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…
– Ancoron
Mar 25 at 5:53
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
You need to use functionjson_extract_path_text(combined_json, 'appl_info')
(assuming that columncombined_json
contains the JSON. Translated into Criteria Query, this means something like:cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
Use the standard
CriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…– Ancoron
Mar 25 at 5:53
Use the standard
CriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…– Ancoron
Mar 25 at 5:53
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
You need to use function
json_extract_path_text(combined_json, 'appl_info')
(assuming that column combined_json
contains the JSON. Translated into Criteria Query, this means something like: cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13
You need to use function
json_extract_path_text(combined_json, 'appl_info')
(assuming that column combined_json
contains the JSON. Translated into Criteria Query, this means something like: cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312571%2fselect-key-from-jsonb-postgresql-using-hibernate-criteria-query-in-java%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312571%2fselect-key-from-jsonb-postgresql-using-hibernate-criteria-query-in-java%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can use functions which are available since JPA 2.1.
– Ancoron
Mar 23 at 10:59
@Ancoron how can i do that ??
– shanu dua
Mar 25 at 4:17
Use the standard
CriteriaBuilder#function
. Example: github.com/thjanssen/HibernateTips/blob/master/…– Ancoron
Mar 25 at 5:53
Thanks i have seen the code but i want to select appl_id from json .how can i do that @Ancoron
– shanu dua
Mar 25 at 10:12
You need to use function
json_extract_path_text(combined_json, 'appl_info')
(assuming that columncombined_json
contains the JSON. Translated into Criteria Query, this means something like:cb.function("json_extract_path_text", String.class, root.get(ApplInfoJson_.combinedJson), "appl_info")
– Ancoron
Mar 28 at 22:13