Giter Club home page Giter Club logo

Comments (5)

my2iu avatar my2iu commented on July 26, 2024

Did you register the function in Hibernate as well?

from jinq.

my2iu avatar my2iu commented on July 26, 2024

To be honest, I didn’t even remember that Jinq had this functionality, so I could be mistaking things, but after dumpster diving through the code, I did find this code snippet that seems to register a SQL function in Hibernate:

  {
     Query q = session.createNativeQuery("CREATE FUNCTION isRegexMatch( str VARCHAR(200), regex VARCHAR(200) ) RETURNS INTEGER LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL EXTERNAL NAME 'org.jinq.hibernate.CreateHibernateDb.isRegexMatch_DbFunction' ");
     q.executeUpdate();
  }

from jinq.

my2iu avatar my2iu commented on July 26, 2024

Or maybe not? To be honest, I no longer remember exactly how any of this works. If you can’t figure it out, let me know and I can look more deeply into the code.

from jinq.

my2iu avatar my2iu commented on July 26, 2024

Actually, maybe you don’t need to register anything. Yeah, I don’t know. I don’t even remember implementing this functionality, let alone whether I tested it with a database other than Apache Derby.

This page here

https://thorben-janssen.com/database-functions/

Seems to say that if Hibernate can’t figure out how to type a function, you may need to register the types with Hibernate using some messy process.

from jinq.

phdbutbachelor avatar phdbutbachelor commented on July 26, 2024

Sorry, I misunderstood the usage of registerCustomSqlFunction, I already solved this problem.

from jinq.

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.