• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

NamedQuery

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it possible to defined a namedquery without using any ORM or Hibernate or JPA

i want to have a parameterized annotation to pass the value and get the query and execute it

The query has the paramters or URL to connect with the third party ad servers.

Please suggest

Thanks
 
Saloon Keeper
Posts: 6211
157
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand the question, but nothing stops you from keeping the SQL queries (for example) in a properties file, and subsequently use a PreparedStatement to execute them.
 
Samuel Christ
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Tim it is not SQL queries. It is Odata queries which i need to execute. The challenge is I want to make it and categorize it as fully object oriented.

When i went through it, i come across named query. please advise what would be the best option
 
Tim Moores
Saloon Keeper
Posts: 6211
157
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It is Odata queries


That was crucial but missing information. Presumably OData has a Java API - doesn't its documentation talk about that?
 
Samuel Christ
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't have this info.....Need your kind help, Tim..

a) We will get all the details from the presentation layer
b) We need to make the query building or query definition generic
c) We need to consume the Odata server APIs

Challenge

a) How to define the entity or attributes or query in a standard approach
b) How to make it generic (have base class or abstract class) so that each class would have only specific extension methods


 
Tim Moores
Saloon Keeper
Posts: 6211
157
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know anything about Odata, nor have I seen it discussed here. Maybe it has support forums or mailing lists where knowledgeable people hang out?
 
Samuel Christ
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sure, Tim. But let's leave odata..but what would be the best way to categorize where we hit third party API's in general.

b) We need to make the query building or query definition generic
c) We need to consume any third party server APIs

Challenge

a) How to define the entity or attributes or query in a standard approach
b) How to make it generic (have base class or abstract class) so that each class would have only specific extension methods
 
Tim Moores
Saloon Keeper
Posts: 6211
157
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's hard to answer because we know so little about what you intend to do. "any third party server APIs"? Do you mean any REST API available out there taking any parameter and returning any result whatsoever? That's a tall order. Some REST APIs (namely those implemented using Jersey) use WADL to describe themselves, while others use OpenAPI. Many SOAP web services make their WSDL available. You could certainly build tools based on these description languages.

As to query building, the description languages mentioned above would certainly give you a head start. You could also look into GraphQL.
 
Marshal
Posts: 6850
182
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Googling odata java api gives us this page from OData.  Clicking the Java tab shows us that Apache Olingo is a Java library that implements Open Data Protocol.

Disclaimer: I know nothing about OData or Olingo, I'm just trying to show you one way to search for the information you need.
 
Destroy anything that stands in your way. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!