cedric
03/19/2019, 3:35 AMinsert
(in the case where it's auto increment, obviously, otherwise I already have it)avolkmann
03/20/2019, 10:26 AMarturo
03/22/2019, 3:06 PMTable()
instead of LongIdTable()
and not using EntityID
at allFarzad
04/02/2019, 1:50 PMselect *
from Orders o,
Customers c
where o.customerId = c.id
and c.id = 1234;
Farzad
04/02/2019, 3:46 PMDennis Schröder
04/04/2019, 8:43 AMEntity.getAll()
I still get an No transaction in context.
Error!
I created each entity in an own transaction. Like described in the documentation!
Any hints where to look at?Antanas A.
04/09/2019, 11:02 AMNezteb
04/18/2019, 10:48 PMKevin Schmeichel
04/24/2019, 6:49 PMpindab0ter
04/26/2019, 11:49 AMvia
for a many to many reference. How do I set up the columns so that it cascades a deletion of either table?tjohnn
04/27/2019, 8:24 AMselect users.*, detail.address as location from users innerjoin detail on users.id = deail.user_id
?bitkid
04/28/2019, 10:50 AMPlayerDAO.find { Players.email eq "someEmail" }.map { it.toPlayer() }
. is that a sane approach just adding a method to the DAO which does the conversion?JohnV
04/28/2019, 8:00 PMvar blocks by Block referrersOn Blocks.articleId
Michal Landsman
04/30/2019, 9:06 PMbitkid
05/13/2019, 9:27 AMtapac
05/14/2019, 11:17 AMMihael
05/14/2019, 4:32 PM[qtp1676605578-16] INFO Exposed - Preparing create tables statements took 1ms
[qtp1676605578-16] INFO Exposed - Executing create tables statements took 3ms
[qtp1676605578-16] INFO Exposed - Extracting table columns took 35ms
[qtp1676605578-16] INFO Exposed - Extracting column constraints took 3ms
[qtp1676605578-16] INFO Exposed - Preparing alter table statements took 38ms
[qtp1676605578-16] INFO Exposed - Executing alter table statements took 1ms
[qtp1676605578-16] INFO Exposed - Checking mapping consistence took 10ms
Jonathan Mew
05/15/2019, 10:55 AMpindab0ter
05/15/2019, 11:50 AMNezteb
05/15/2019, 3:47 PMQueryBuilder
to get plain SQL statements that can be executed?
It’s mentioned in the FAQ, but no where else in any documentation that I can find: https://github.com/JetBrains/Exposed/wiki/FAQ#q-how-to-get-a-plain-sql-query-which-will-be-executedKevin Schmeichel
05/16/2019, 9:22 PMKevin Schmeichel
05/17/2019, 12:22 AMmatch
operator IN NATURAL LANGUAGE MODE
?Mihael
05/20/2019, 6:31 PMSessions.select { Sessions.lastUpdated greaterEq DateTime.now().minusSeconds(5).millis }
Is this the best way of getting current time - 5 seconds with exposed?Mihael
05/25/2019, 8:29 PMsql
```SELECT A.script_name, A.count, (A.count * 100) / totalCount AS percentage, totalCount
FROM (SELECT script_name, COUNT(*) AS count FROM sessions WHERE client_username = "Miha" GROUP BY script_name) AS A
INNER JOIN (SELECT COUNT(*) AS totalCount FROM sessions WHERE client_username = "Miha") AS B
GROUP BY A.script_name
```
Can anyone help me write this in Exposed kotlin?
I’ve tried using aliases but was never able to select totalCount from a subquery or the main query.APXEOLOG
05/28/2019, 6:43 AMpindab0ter
06/06/2019, 2:50 PMPRAGMA foreign_keys = OFF;
. I’ve tried setting that using:
transaction {
exec("PRAGMA foreign_keys = ON;")
}
But still no luck. Any ideas?Viet Hoang
06/07/2019, 8:38 AMTable1.leftJoin(otherTable = Table2, onColumn = { Table1.id }, otherColumn = { Table2.table1Id })
.leftJoin(otherTable = Table3, onColumn = { Table1.table3Id }, otherColumn = { Table3.id })
.join(otherTable = Table4, joinType = JoinType.LEFT, additionalConstraint = { (Table1.table5Id eq Table4.table5Id) and (Table1.table3Id eq Table4.table3Id) })
.leftJoin(otherTable = Table5, onColumn = { Table1.table5Id }, otherColumn = { Table5.id })
.leftJoin(otherTable = Table6, onColumn = { Table1.table5Id }, otherColumn = { Table6.table5Id })
.leftJoin(otherTable = Table7, onColumn = { Table3.table7Id }, otherColumn = { Table7.id })
.leftJoin(otherTable = Table8, onColumn = { Table7.table8Id }, otherColumn = { Table8.id })
.leftJoin(otherTable = Table9, onColumn = { Table5.table9Id }, otherColumn = { Table9.id] })
.leftJoin(otherTable = Table10, onColumn = { Table2.table10Id }, otherColumn = { Table10.id })
.leftJoin(otherTable = Table11, onColumn = { Table2.table11Id }, otherColumn = { Table11.id })
.leftJoin(otherTable = Table12, onColumn = { Table2.table12Id }, otherColumn = { Table12.id })
.select {
println("JOIN: " + (System.currentTimeMillis() - start)/1000)
start = System.currentTimeMillis()
Table1.id inList ids
}
.map {
println("EXECUTE: " + (System.currentTimeMillis() - start)/1000)
it.toMasterData()
}
It took roughly 3 seconds just for generating query when executed in my local environment.rapho
06/10/2019, 3:20 PMTableA.selectAll().where(TableA.ref1 = object1 and TableA.ref2= object2)
Nikky
06/11/2019, 6:13 PMMihael
06/13/2019, 12:50 PMSELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('SessionId')
AND TABLE_SCHEMA='YourDatabase';
Mihael
06/13/2019, 12:50 PMSELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('SessionId')
AND TABLE_SCHEMA='YourDatabase';
tapac
06/13/2019, 5:19 PMval result = ColumnsTable.
slice(ColumnsTable.tableName).
select {
ColumnsTable,columnName inList listOf("SessionId") and
( ColumnsTable.tableSchema eq "YourDatabase"}.
withDistinct().map { it[ColumnsTable.tableName]
}
Mihael
06/13/2019, 11:13 PM