Giter VIP home page Giter VIP logo

Comments (3)

j256 avatar j256 commented on September 28, 2024

Welcome @RichardForsey89 . I don't quite understand what you are saying. Are you saying that the SQL generated doesn't add in some SQLite specific Foreign Key tag? ORMLite's SQL generation certainly does have some holes. Can you create your schema by hand (yes a pain) and then use ORMLite just for the entities?

In the future, be careful of statements like "doesn't work" and be more specific. Thanks.

from ormlite-jdbc.

RichardForsey89 avatar RichardForsey89 commented on September 28, 2024

Thank you for the quick reply Gray. The generated schema would be missing the Foreign Key constraint, which would then cause issues with INSERTs to Profiles where a child Workspace would be generated, but the child workspace wouldn't have the profile_id filled in, but the Profile entity would have a field of workspace_id filled with the child's. So at first glace it would seem that using ORMlite for the entities would be troublesome for my situation.

I admit that I could be incorrect with my expectations/application of ORMlite. Am I to understand that the Foreign Key constraint is only enforced at the software layer, rather than in the schema?

Also, I'll be more careful of my language in future.

from ormlite-jdbc.

j256 avatar j256 commented on September 28, 2024

Supporting perfect schema generation on all of the supported database types is hard. Right now its doesn't setup foreign key constraints unfortunately. I would recommend adding them afterwards by hand. You can use the Dao.executeRaw(...) method for this.

from ormlite-jdbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.