Comments (32)
Any news?
from exposed.
5 years later we still need it. Really )
from exposed.
Bump :)
from exposed.
Bump :)
from exposed.
Bumping because this is ridicolous, I just made an IntIdTable now without using the Id ever.
from exposed.
This issue was created 4 years ago, how is this not fixed yet?
You should ask for your money back
from exposed.
bump
from exposed.
@Nek-12 Merry Christmas, any updates?
Yeah, lots of updates: I finished school, got into university, finished university, started my masters, found a job and left that job. What a great 8 years!
from exposed.
bump! ⏳
from exposed.
@Hc747, not yet.
from exposed.
@kamyar1979 , sad, but there is not workaround atm, because entityId is a hardly coupled with a single column instance. We have uncompleted refactoring with this feature support, but it requires a lot of testing before release, so we can't give any ETA :(
from exposed.
bump
from exposed.
I believe that I found a solution:
https://stackoverflow.com/questions/57633755/kotlin-exposed-entity-for-table-with-no-identity-column
from exposed.
Merry christmas guys
from exposed.
Hi, @jorginius .
It's not possible at the moment, but I hope we can fix it in a while.
Do you have any experience with EmbeddedId or IdClass approach? Or maybe you can share your vision how it might be implemented to be mostly useful?
from exposed.
Hi, @Tapac .
I commented about the EmbeededId (and Embeddable) annotation because I think it could be the less disruptive approach (one object key, one parameter), but I'm not sure if mimicking JPA is the right way on this point:
@Embeddable
public class UserToRoleKey {
@Column(nullable = false)
private String code;
@Column(nullable = false)
private String username;
// ...
}
@Entity
public class UserToRole {
@EmbeddedId
private UserToRoleKey key;
// ...
}
// ...
UserToRoleKey key = new UserToRoleKey();
key.setCode("USER");
key.setUsername("test);
entityManager.find(UserToRole.class, key);
"Raw" Table objects can hold a composite key easily:
internal object UsersToRoles : Table("users_roles") {
val code = reference("code", Roles.code).primaryKey()
val username = reference("username", Users.username).primaryKey()
}
Perhaps the ideal API :-) has a EntityClass which works with Table objects (creating EntityId from primaryId fields automatically) or IdTable is deprecated/superseded by the "vanilla" Table, i don't know.
from exposed.
It is my only problem in current project! Please lead me with a workaround at least!
from exposed.
Sorry! I have to return to old Hibernate for now!
from exposed.
Need this feature as well :(
from exposed.
A very ugly and <8 bit int-specific work around I've been using:
object dgmtypeeffects: IntIdTable(columnName = "typeID\" << 8 | \"effectID") {
val typeID = integer("typeID").primaryKey()
val effectID = integer("effectID").primaryKey()
val isDefault = bool("isDefault")
val effect = reference("effectID", dgmeffects)
val type = reference("typeID", invtypes)
fun idFromPKs(typeID: Int, effectID: Int): Int {
return typeID shl 8 or effectID
}
fun findFromPKs(typeID: Int, effectID: Int): dgmtypeeffect? {
return dgmtypeeffect.findById(idFromPKs(typeID, effectID))
}
}
class dgmtypeeffect(id: EntityID<Int>): IntEntity(id) {
companion object: IntEntityClass<dgmtypeeffect>(dgmtypeeffects)
var typeID by dgmtypeeffects.typeID
var effectID by dgmtypeeffects.effectID
var isDefault by dgmtypeeffects.isDefault
val effect by dgmeffect referencedOn dgmtypeeffects.effect
val type by invtype referencedOn dgmtypeeffects.type
}
findByPKs returns the correct object, and accessing these by references in other tables works, I can't say more than that.
The shift could be adjusted, and more values could be added.
from exposed.
seems there is a solution here: #239
from exposed.
Have there been any updates on this?
from exposed.
This issue was created 4 years ago, how is this not fixed yet?
from exposed.
@Tapac is there any README about this on-going feature that the community can read and try to contribute?
from exposed.
Bump 🆙
from exposed.
Bump
from exposed.
bump
from exposed.
bump
from exposed.
happy new year
from exposed.
bump
from exposed.
bump
from exposed.
@Nek-12 Merry Christmas, any updates?
from exposed.
Related Issues (20)
- Make it spring-boot 3 compatible HOT 6
- Lacking documentation HOT 2
- IdentifierManagerApi throws error when it has been accessed from multiple threads HOT 2
- Many to many reference - exception when adding new record HOT 2
- EntityHooks are not invoked when using DSL API
- EntityClass companion object constructor is not invoked because it's not referenced anywhere
- Using exists in subquery HOT 1
- Support quotes when using schema in the tablename HOT 4
- Any way to determine entity state? HOT 1
- Update with join fails on H2 in MySql mode HOT 1
- Is it maintained? HOT 1
- [Crash] ClassNotFound when running with DEBUG environment variable set to false HOT 4
- Can be support regex query dsl?
- Can be support table and column comment? HOT 1
- Provided Column Type Not Included In Operators For Primitive Value Types HOT 7
- Combination of Spring-based transactions and newSuspendedTransaction does not work properly HOT 2
- Unnecessary query after calling with() and iteration. HOT 3
- Design flaws with insert HOT 1
- postgresql plus string HOT 1
- in dsl section dao IntIdTable is proposed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exposed.