The type org.jfree.data.general.Series cannot be resolved - jfreechart

I have been updating my development environment to Eclipse Neon and introducing m2e to manage project dependencies. in one project the original (very old) versions of JFreeChart were not available on maven so I have put in the latest versions of JFreeChart and JCommon.
I now have one compile error, described below:
The type org.jfree.data.general.Series cannot be resolved.
It is indirectly referenced from required .class files.
I have found a number of questions and answers about this, but they seem to relate to the absence of JCommon. I have JCommon in my dependencies, and I have checked the specific class that is referred to is actually in the jfreechart.jar file with 7-zip.
Below is the code fragment with the error, which occurs on the last else statement results.add(…).
public XYDataset getMetricHistogramData(Timestamp t1, Timestamp t2){
int index1=-1;
Timestamp startTime,endTime;
TimePeriodValues results = new TimePeriodValues(this.type.name());
final TimePeriodValuesCollection results1 = new TimePeriodValuesCollection();
if (t1.before(earliest)||t1.after(latest)||(readings.size()<=1)) return null; // won't find a value for the timestamp t1
if (t2.before(earliest)||t2.after(latest)) return null; // won't find a value for the timestamp t2
for(int i = 0;i<readings.size();i++){
if (readings.get(i).timestamp().equals(t1)){
index1=i;
break;
}
if (readings.get(i).timestamp().after(t1)){
index1=i-1;
break;
}
}
// index1 now contains the index of the starting timestamp
for (int i=index1; i<(readings.size()-1); i++){
startTime = readings.get(i).timestamp();
if(startTime.after(t2)) break;
//endTime = new Timestamp(Math.abs(readings.get(i+1).timestamp().getTime()-Timestamped.SECOND_IN_MS));
endTime = readings.get(i+1).timestamp();
if (endTime.before(startTime))
SmartPower.getMain().getFrame().displayLog("Bad Timestamps "+startTime + " - " + endTime+"\n\r");
else results.add(new SimpleTimePeriod(startTime, endTime), readings.get(i).value());
}
results1.addSeries(results);
return results1;
}
This is my pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SmartPower</groupId>
<artifactId>SmartPower</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.eclipse.persistence/javax.persistence -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jfree/jfreechart -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jfree/jcommon -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jcommon</artifactId>
<version>1.0.23</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jgoodies/forms -->
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
</dependencies>
</project>
Neon was a clean install about a week ago on windows 10.
Any pointers would be appreciated.

I'm not sure where things are going awry. The class org.jfree.data.general.Series is indeed included in jfreechart-1.0.19.jar. You might try running from the command line with the -verbose option, as suggested here, to check for stray JARs. Using the 1.0.19 release,
$ java -verbose -cp .:lib/jfreechart-1.0.19.jar:lib/jcommon-1.0.23.jar Test
…
[Loaded org.jfree.data.general.SeriesDataset from file:lib/jfreechart-1.0.19.jar]
[Loaded org.jfree.data.xy.XYDataset from file:lib/jfreechart-1.0.19.jar]
…
Using the versions cited, the following simplified example produces the following chart without error:
import java.awt.Dimension;
import java.awt.EventQueue;
import javax.swing.JFrame;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimePeriodValues;
import org.jfree.data.time.TimePeriodValuesCollection;
import org.jfree.data.xy.XYDataset;
/**
* #see https://stackoverflow.com/a/38725689/230513
*/
public class Test {
private void display() {
JFrame f = new JFrame("Test");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new ChartPanel(ChartFactory.createTimeSeriesChart(
"Title", "Domain", "Range", createDataset())) {
#Override
public Dimension getPreferredSize() {
return new Dimension(640, 480);
}
});
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
private XYDataset createDataset() {
TimePeriodValues results = new TimePeriodValues("Data");
results.add(new Day(1, 8, 2016), 1);
results.add(new Day(2, 8, 2016), 2);
return new TimePeriodValuesCollection(results);
}
public static void main(String[] args) {
EventQueue.invokeLater(new Test()::display);
}
}

Related

How to assert an actual value against 2 or more expected values in TestNG

Automating an insurance application. Writig TestNG assertions for selenium web driver tests to verify the start date of the policy, which is by default today's date.
But in some cases it can be tomorrow's date depending on insurers and schemes. I want to include this in the assertion. But I want to validate for any of these two, start date=Today or Tomorrow. want to combine following 2 assertions.
I can do it by creating a third boolean variable and check the date to see if it matches with one of these and making the boolean true and do a boolean assertion, anyone know any other way to do this directly in testNG.
1. Assert.assertEquals(start_date, date_today, "Assertion failed- Start Date");
2. Assert.assertEquals(start_date, date_tomorrow, "Assertion failed- Start Date");
In junit we have something like
assertThat(result, isOneOf("value1", "value2"));
is available to assert similar situation.
Can we do same operation in testNG?
Just as with this similar question, not implicitly. BTW assertThat in JUnit relies probably on a Hamcrest matcher, maybe an older version. Anyway you have at least the following options:
use TestNG's assertTrue
use an additional library such as Hamcrest, AssertJ, etc
Dependencies:
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.9.0</version>
<scope>test</scope>
</dependency>
Code:
import org.testng.annotations.Test;
import java.time.LocalDate;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.testng.Assert.assertTrue;
public class SomeTest {
#Test // compare strings (usually that's what you get as values from a webpage)
public void shouldCheckMultipleStringValues() {
// simulate some data
String myText = "my text";
// TestNG
assertTrue(myText.equals("my text") || myText.equals("your text") || myText.equals("his text"));
//Hamcrest
assertThat(myText, anyOf(equalTo("my text"), equalTo("your text"), equalTo("his text")));
// AssertJ
assertThat(myText).isIn("my text", "your text", "his text");
}
#Test // but you can even compare dates if you need to
public void shouldCheckMultipleDateValues() {
// simulate some date
LocalDate myDate = LocalDate.now();
// simulate a bunch of expected dates
LocalDate yesterday = LocalDate.now().minusDays(1);
LocalDate now = LocalDate.now();
LocalDate tomorrow = LocalDate.now().plusDays(1);
// TestNG
assertTrue(myDate.equals(yesterday) || myDate.equals(now) || myDate.equals(tomorrow));
//Hamcrest
assertThat(myDate, anyOf(equalTo(yesterday), equalTo(now), equalTo(tomorrow)));
// AssertJ
assertThat(myDate).isIn(yesterday, now, tomorrow);
assertThat(myDate).isBetween(yesterday, tomorrow);
}
}
I would calculate the number of days and do a single assertion on that figure:
long days = ChronoUnit.DAYS.between(start_date, date_today);
assertTrue((days >= 0) && (days <= 1));

How to connect Spring to Oracle Database using eclipse IDE.

I couldn't connect the spring application with oracle db (12c). I have installed the jdbc8 (java to oracle driver) locally and installed all the spring and jdbc dependencies.
Can anyone please help me with it. I'm unable to run the application (access and update the database ). maven build was successful and compilation was sucessful.
Steps I followed to run the application:
1) build as maven clean.
2) run the application. (not on apache)
****console log:
Oracle 12.2.0.1.0 JDBC 4.2 compiled with javac 1.8.0_91
***** JCE UNLIMITED STRENGTH IS INSTALLED ********
Code for contact.java
package net.codejava.spring;
/**
*
* #author www.codejava.net
*
*/
public class Contact {
private String name;
private String email;
private String address;
private String phone;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String telephone) {
this.phone = telephone;
}
public String toString() {
return String.format("[%s - %s - %s - %s]", name, email, address, phone);
}
}
code for SpringJDBCTemplateExmaple.java
package net.codejava.spring;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
/**
* This console application demonstrates how to do CRUD operations using JDBC
* with Spring framework.
* #author www.codejava.net
*
*/
public class SpringJDBCTemplateExample {
public static void main(String[] args) throws SQLException {
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
dataSource.setDriver(new oracle.jdbc.OracleDriver());
dataSource.setUrl("jdbc:oracle:thin:#localhost:1521:ORCL");
dataSource.setUsername("system");
dataSource.setPassword("Welcome1");
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
String sqlInsert = "INSERT INTO contact (name, email, address, telephone)"
+ " VALUES (?, ?, ?, ?)";
jdbcTemplate.update(sqlInsert, "Tom", "tomea#mail.com", "USA", "12345");
String sqlUpdate = "UPDATE contact set email=? where name=?";
jdbcTemplate.update(sqlUpdate, "tomee#mail.com", "Tom");
String sqlSelect = "SELECT * FROM contact";
List<Contact> listContact = jdbcTemplate.query(sqlSelect, new RowMapper<Contact>() {
public Contact mapRow(ResultSet result, int rowNum) throws SQLException {
Contact contact = new Contact();
contact.setName(result.getString("name"));
contact.setEmail(result.getString("email"));
contact.setAddress(result.getString("address"));
contact.setPhone(result.getString("telephone"));
return contact;
}
});
for (Contact aContact : listContact) {
System.out.println(aContact);
}
String sqlDelete = "DELETE FROM contact1 where name=?";
jdbcTemplate.update(sqlDelete, "Tom");
}
}
code for pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.codejava.spring</groupId>
<artifactId>SpringJDBCTemplateExample</artifactId>
<version>1.0</version>
<name>SpringJDBCTemplateExample</name>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.1.0.1</version>
</dependency>
</dependencies>
contact table:
CREATE TABLE contact (
contact_id integer NOT NULL,
name varchar(45) NOT NULL,
email varchar(45) NOT NULL,
address varchar(45) NOT NULL,
telephone varchar(45) NOT NULL,
CONSTRAINT contact_pk PRIMARY KEY (contact_id)
);
The code in your SpringJDBCTemplateExample main method looks correct & should work provided all the parameters are correct for your setup, e.g.
dataSource.setUrl("jdbc:oracle:thin:#localhost:1521:ORCL");
dataSource.setUsername("system");
dataSource.setPassword("Welcome1");
So if you do have an Oracle database with SID or service name "ORCL" listening on your local port 1521, and there is a "system" user with password "Welcome1" then the JdbcTemplate should be able to use that DataSource to connect.
If the connection fails, an exception would be thrown and you should see a stacktrace output which will tell you what is wrong. For example, if the password was wrong, you should see something like: -
Exception in thread "main" org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: ORA-01017: invalid username/password; logon denied
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:630)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980)
...
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
Now ... if you are running your SpringJDBCTemplateExample and you don't see any output from your program, then I would think you have something either wrong with the logging setup or the standard output is being redirected somewhere.

How to get stored procedure code from the database? [duplicate]

When I try to retrieve stored procedures from an SQL Server database using the SchemaCrawler API, I get this error:
12:28:07.427 [main] INFO schemacrawler.crawl.SchemaCrawler - Retrieving routines
12:28:07.767 [main] WARN schemacrawler.crawl.RoutineRetriever - JDBC driver does not support retrieving functions
java.lang.AbstractMethodError: null
at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getFunctions(JtdsDatabaseMetaData.java:3570) ~[jtds-1.3.1.jar:1.3.1]
at schemacrawler.crawl.RoutineRetriever.retrieveFunctions(RoutineRetriever.java:175) ~[schemacrawler-14.02.02.jar:na]
at schemacrawler.crawl.SchemaCrawler.crawlRoutines(SchemaCrawler.java:214) [schemacrawler-14.02.02.jar:na]
at schemacrawler.crawl.SchemaCrawler.crawl(SchemaCrawler.java:564) [schemacrawler-14.02.02.jar:na]
at schemacrawler.utility.SchemaCrawlerUtility.getCatalog(SchemaCrawlerUtility.java:49) [schemacrawler-14.02.02.jar:na]
at schemacrawler.utility.SchemaCrawlerUtility.getCatalog(SchemaCrawlerUtility.java:57) [schemacrawler-14.02.02.jar:na]
at com.expedia.cgs.db.ExportScripts.main(ExportScripts.java:41) [classes/:na]
The jtds driver supports DatabaseMetaData.getProcedures() but not DatabaseMetaData.getFunctions(). Is there a workaround?
UPDATE: Here is my code:
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.slf4j.bridge.SLF4JBridgeHandler;
import schemacrawler.schema.Catalog;
import schemacrawler.schema.Column;
import schemacrawler.schema.Routine;
import schemacrawler.schema.Schema;
import schemacrawler.schema.Table;
import schemacrawler.schema.View;
import schemacrawler.schemacrawler.DatabaseConnectionOptions;
import schemacrawler.schemacrawler.RegularExpressionInclusionRule;
import schemacrawler.schemacrawler.SchemaCrawlerException;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaInfoLevelBuilder;
import schemacrawler.utility.SchemaCrawlerUtility;
public class ExportScripts {
public static void main(String[] args) throws SchemaCrawlerException, SQLException {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
// Create a database connection
final DataSource dataSource = new DatabaseConnectionOptions("jdbc:sqlserver://myDatabase;appName=SchemaCrawler;useCursors=true");
final Connection connection = dataSource.getConnection("username", "password");
// Create the options
final SchemaCrawlerOptions options = new SchemaCrawlerOptions();
// Set what details are required in the schema - this affects the
// time taken to crawl the schema
options.setSchemaInfoLevel(SchemaInfoLevelBuilder.standard());
options.setRoutineInclusionRule(new RegularExpressionInclusionRule("ContentGeneration\\.dbo.*"));
options.setSchemaInclusionRule(new RegularExpressionInclusionRule("ContentGeneration\\.dbo.*"));
// Get the schema definition
final Catalog catalog = SchemaCrawlerUtility.getCatalog(connection,
options);
for (final Schema schema : catalog.getSchemas()) {
System.out.println(schema);
for (final Routine routine : catalog.getRoutines()) {
System.out.println("r--> " + routine);
System.out.println("definition: " + routine.getDefinition());
}
for (final Table table : catalog.getTables(schema)) {
System.out.print("o--> " + table);
if (table instanceof View) {
System.out.println(" (VIEW)");
} else {
System.out.println();
}
for (final Column column : table.getColumns()) {
System.out.println(" o--> " + column + " ("
+ column.getColumnDataType() + ")");
}
}
}
}
}
Here is how to get full SchemaCrawler support for Microsoft SQL Server.
Include the SchemaCrawler jar that has Microsoft SQL Server support, in your Maven project.
<dependency>
<groupId>us.fatehi</groupId>
<artifactId>schemacrawler-sqlserver</artifactId>
<version>14.02.02</version>
</dependency>
Use code similar that this below.
final DatabaseSystemConnector dbSystemConnector = new SqlServerDatabaseConnector().getDatabaseSystemConnector();
final DatabaseSpecificOverrideOptions databaseSpecificOverrideOptions = dbSystemConnector.getDatabaseSpecificOverrideOptionsBuilder().toOptions();
final SchemaCrawlerOptions schemaCrawlerOptions = new SchemaCrawlerOptions();
schemaCrawlerOptions.setSchemaInfoLevel(InfoLevel.maximum.buildSchemaInfoLevel());
final Catalog catalog = SchemaCrawlerUtility.getCatalog(getConnection(), databaseSpecificOverrideOptions, schemaCrawlerOptions);
Loop over the routines, and use Routine.getDefinition() to get the definitions.
Sualeh Fatehi, SchemaCrawler

owlapi how to add a OWLDatatype to OWLClass

So I have been able to add some classes to an ontology and save them to a file. Now I would like to be able to add a Datatype to my class but I am confused about how to do this probably very simple thing. This is what I have been trying:
OWLClass currentClass =df.getOWLClass(IRI.create("Base"));
OWLDataProperty owlAttr = df.getOWLDataProperty(IRI.create("#" + "name");
OWLLiteralImplString lit = new OWLLiteralImplString("test"); //This is probably on the wrong path
DefaultPrefixManager defaultPrefixManager = new DefaultPrefixManager();
OWLDatatype datatype = df.getOWLDatatype("xsd:string",defaultPrefixManager);
OWLAxiom axiom = df.getOWLDatatypeDefinitionAxiom(datatype, ?); //having trouble find a range.
Edit #1 So I'm a little concerned my question isn't clear. What I am trying to do would be similar to this in Java:
public class Car{
}
I currently am able to create a class using the owlapi but what I am looking to do would be like adding a datamember to my Java class:
public class Car{
public String manufacturer;
}
Using Protege I can produce this which I think is what I want to be able to make with the owlapi:
<!-- http://www.co-ode.org/ontologies/ont.owl#manufacturer -->
<DatatypeProperty rdf:about="http://www.co-ode.org/ontologies/ont.owl#manufacturer">
<rdfs:domain rdf:resource="http://www.co-ode.org/ontologies/ont.owl#Car"/>
<rdfs:range rdf:resource="&xsd;string"/>
</DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.co-ode.org/ontologies/ont.owl#Car -->
<Class rdf:about="http://www.co-ode.org/ontologies/ont.owl#Car"/>
Something like this might help:
OWLDatatype datatype = factory.getOWLDatatype("xsd:string",pm);
OWLLiteral lit= factory.getOWLLiteral("1", datatype);
Maybe you want to define min and max restriction:
OWLDataUnionOf union = factory.getOWLDataUnionOf( factory.getOWLDatatypeMinInclusiveRestriction(1), factory.getOWLDatatypeMaxInclusiveRestriction(10));
OWLDatatypeDefinitionAxiom axiom = factory.getOWLDatatypeDefinitionAxiom(datatype, union);
Edit #1: I have added new code based on the edited question.
PrefixManager pm= new DefaultPrefixManager("http://www.co-ode.org/ontologies/ont.owl#");
OWLDataPropertyExpression man= factory.getOWLDataProperty("manufacturer", pm);
OWLClass car= factory.getOWLClass("Car", pm);
OWLDatatype dt = factory.getOWLDatatype("xsd:string",pm);
OWLDataPropertyDomainAxiom domain=factory.getOWLDataPropertyDomainAxiom(man, car);
OWLDataPropertyRangeAxiom range= factory.getOWLDataPropertyRangeAxiom(man, dt);

GAE JPA Illegal argument when trying to edit entites from query

i am breaking my self with this problem and i would need some help. I am trying to edit queries but i keep getting this error
javax.persistence.PersistenceException: Illegal argument
...
Caused by: java.lang.IllegalArgumentException: operating on too many entity groups in a single transaction.
...
this is the part of code i use to update records
final EntityManager em = PersistenceManager.getInstance().getEntityManagerFactory().createEntityManager();
try {
//em.getTransaction().begin();
{
Query q = em.createQuery(String.format("SELECT FROM %s cat", NewsContent.class.getSimpleName()));
int count = 0;
for(NewsContent nc : (List<NewsContent>) q.getResultList()){
nc.setOrderTimestamp(nc.getTimestamp());
count++;
}
resp.setContentType("text/plain");
resp.getWriter().println("NewsContent:\n\t Updated " + count + " records\n" );
}
//em.getTransaction().commit()
} finally {
//if(em.getTransaction().isActive())
// em.getTransaction().rollback();
em.close();
}
this is the part from persistance.xml
<provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider>
<properties>
<property name="datanucleus.NontransactionalRead" value="true"/>
<property name="datanucleus.NontransactionalWrite" value="true"/>
<property name="datanucleus.ConnectionURL" value="appengine"/>
<property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true"/>
<property name="datanucleus.singletonEMFForName" value="true"/>
</properties>
and this is JPA Entity(I removed setters and getters)
#Entity
public class NewsContent {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
Key ID;
String api_key;
String author_username;
String author_displayname;
String organization;
String organization_displayname;
long timestamp;
String api_type;
long order_timestamp;
Text text = null;
String title = null;
String title2 = null;
String extra = null;
String extra_desc = null;
Boolean featured = false;
String category = null;
String imageID = null;
String image_serving_url = null;
}
Any idea?
Your JPQL is incorrect.
SELECT FROM %s cat
It should be
Select cat from %s cat
A common format of jpql that picks all the columns from a table.
select o from TableName o where o.id=1
If you wish to pick a single column, then it will be
select o.colName from TableName o where o.id=1

Resources