How to do a group by on audit table using hibernate envers? - hibernate-envers

I'd like to apply group by on an audit table using hibernate envers.
How can I do that?

Group by is unfortunately not supported by Envers.

Related

JPA get table names from a certain mysql database

I am working on a project where i must get all table names using JPA then store the names somewhere. Using mysql query I can use "Show tables" but using that in JPA doesn't work.How can i achieve this?
I never tried something like that but you can try with that query:
SELECT table_name FROM information_schema.tables where table_schema='<your_database_name>';

DB2 table access list

i want to find db2 tables access list(which user or program has privilige which table). how can i query this?
If i would write this psedue code i wil be like this.
select table's_grant_user_name from sysibm.... where table_name='XXX'`
is there any ibm privillige table been in db2?
In aqt tool i can see tables access list when i select from combobox. But i need this query to querying for some tables to groupping.
is it possible to query this ? how can i retrieve table's grant list?
Thanks,
Check out the view SYSIBMADM.PRIVILEGES.

How to delete records using jdbcTemplate. Query where clause with like clause

I want to delete huge data (above 100K) from table using spring jdbcTemplate. Where clause contains like. eg. DELETE from TABLE_NAME where NAME like 'ABC%'. If possible how to use batching. Please suggest. thanks

Create view with jpa eclipselink

I'm working with two databases and I want a column in table1 of the first database to make reference
to a row in table2 in the second database. I'm asking if I could create a view to select columns from
database1 and database2, is it possible?
Have you tried the sample of the Eclipse site?
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Composite
With composite pattern you can use Two or more persistence units combined into a single persistence Unit.

PostgreSQL: How to delete dynamically created table using SQL

I am developing a windows application and using Postgres as backend database. At some point in my application i am dynamically creating table e.g Table1, then Table2 and so on. In this way i have many dynamic table in my database. Now i provide a button "Clean Database", so i need to remove all those dynamic tables using SQL query. Should some one guide me how to write SQL Query that automatically delete all such tables?
You should just be able to say
DROP TABLE {tablename}
for each dynamically created table. Try that and see if it works.