I'm developing something using jpa and sql server 2008 and I'm getting the following error
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting date and/or time from character string.
Error Code:…
I'm trying to putting up my first join with Symfony2 createNativeQuery.
I made the first one without join and there's no problem.
I think I lost some steps, to follow my code:
$rsm = new ResultSetMapping;
$rsm
…
I have created a native query
Query q=em.createNativeQuery("select *\n" +
"from contaarticoli ca,articolo a\n" +
"where ca.articolo=a.id\n" +
"order by ca.qta desc\n" +
"limit 1;");
In workbench i have created a view :
create view…
I have 2 separate tables mapped to SharedThing and TeamMember.
I have the following named query;
SELECT sharedThing
FROM SharedThing sharedThing,
TeamMember teamMember
WHERE teamMember.sharedId = sharedThing.sharedId
AND teamMember.userId…
I want to execute this query using native query
SELECT name FROM `question`
ORDER BY RAND()
LIMIT 20
but when executing it i'm getting thgis error
Exception Description: Syntax error parsing the query
[Question.findrandom: SELECT q FROM…
We use app engine with CloudSQL and from time to time we get the following exception. It happens only when we do a native query from Java (it does not happen when we use JPA). Any idea how to get rid off it?
Exception [EclipseLink-4002] (Eclipse…
I'm trying to insert a function on database via native query, like this
EntityManagerImpl entityManagerFunctionConta = (EntityManagerImpl) GermantechEntityManager.getEntityManager();
EntityTransaction transactionFunctionConta =…
lets say i have a table test with columns id and name
on my bean i got this query
public List getTestList(){
Query q = em.createNativeQuery("select * from test");
List list = q.getResultList();
return list;
}
and on my jsf page i have:
What would be the correct way writing JPA native queries with joins and with Eclipselink JPA2.0 entities?
Can some one tell me to execute the following SQL query using Eclipselink JPA native queries or JPQL?
SQL query is:
Select…
I have 2 tables Sponsors and Study.
The columns in Sponsor and Study tables are:
Sponsors table structure:
SponsorId: int primary key auto_increment,
SponsorName: varchar(30) unique not null,
Address: varchar(255)
Study table structure:
StudyId int…
i need to change my query from native-query to (named-query or create-query) in jpa.
em = getEntityManager();
String query = "SELECT kcu.table_Name FROM INFORMATION_SCHEMA.key_column_usage kcu,Information_schema.Tables kt " +
"WHERE…
i am having a tables
login [login_id, login name]
user[username, login_id, domain_id]
doamin[domain_id,domain_name]
i will pass a login name. and i need to get the domain name the sql query for that is
SELECT m_domain.email FROM ( …
I want to show it in my response distance field, but I am not able to do it please help.
Here is my repo class in alias name (distance) I need to attach this distance column with my list of user results.
Repository
String countDistanceQuery = "(3959…
In a spring boot project and database SQL Server, I'm doing some inserts where I need to return the id of the record
I have a Entity with few fields:
public class PackGroupEntity{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
…