Comments (5)
I posted this to the mailing list back in december. Posting again so it's preserved :)
I tested this with Scala 2.7.3 and the Lift 1.0 release.
Recently I wanted to have a Mapper with a String uuid as primary key. I found out that MappedStringIndex does that. It didn't work though.
Using it with with a derby driver threw this exception:
Caused by: java.sql.SQLException: 'ID' cannot be a column of a
primary key or unique key because it can contain null values.
The create table looked here like it generated the id itself, so the lift generated id isn't saved in the db.
Using the H2 driver:
CREATE TABLE myuuidmapper (id VARCHAR(64)) INSERT INTO myuuidmapper () VALUES ()
This means the table has been created but the lift-generated id was not saved in the database.
I attached an example project. Boot.scala is configured to use the Derby driver. If requested I can provide an example for H2.
from framework.
This is in progress, and dependent on issue #231 making it into trunk. We'll have to discuss whether we want to back-port some of the related code into the 1.0 line.
from framework.
This works now in 1.1-SNAPSHOT by modifying the MyUuidMapper class to change:
object id extends MappedStringIndex(this, 64)
to
object id extends MappedStringIndex(this, 64) {
override def dbNotNull_? = true
override def dbAutogenerated_? = false
}
from framework.
Imported from GitHub: http://github.com/dpp/liftweb/issues/13/find
from framework.
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/13
from framework.
Related Issues (20)
- SameSite cookie support for Lift HOT 1
- FutureWithSession is missed in artefact for Scala 2.13
- No clear migration path for lift-json library (Scala 2.10 -> 2.12)
- The build lift instructions in Readme don't work HOT 3
- Project fails new git protocol security
- Project fails on Apple Silicone (aarch64)
- Update sbt-lift-build plugin
- scala-xml version incompatible with scala 2.12.17 HOT 4
- Lift 4: Support Scala 3 Exclusively HOT 1
- Lift 4: Support dpp's JSON macros
- Lift 4: Misc updates/enhancements
- Lift 4: interop with client side "single page" apps
- Lift 4: update dependencies
- Lift 4: Web Sockets
- Lift 4: Support for JSON columns in Mapper
- Lift4: Support for Env Vars in configuration HOT 5
- Middleware support for APIs and Stateful HTML processing
- Included JWT support
- Generation of OpenAPI Docs from code
- Ingestion of OpenAPI Docs to generate an API
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 framework.