pgjson | #ORM | postgres json type support for hibernate.

 by   bazar-nazar Java Updated: 3 years ago - pgjson-1.3 License: No License

Download this library from

Build Applications

kandi X-RAY | pgjson REVIEW AND RATINGS

postgres json type support for hibernate.

kandi-support
Support

  • pgjson has a low active ecosystem.
  • It has 23 star(s) with 9 fork(s).
  • It had no major release in the last 12 months.
  • On average issues are closed in 215 days.
  • It has a neutral sentiment in the developer community.

quality kandi
Quality

  • pgjson has no issues reported.

security
Security

  • pgjson has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

license
License

  • pgjson does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.

build
Reuse

  • pgjson releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
Top functions reviewed by kandi - BETA

kandi has reviewed pgjson and discovered the below as its top functions. This is intended to give you an instant insight into pgjson implemented functionality, and help decide if they suit your requirements.

  • set the value in the prepared statement
  • Retrieves a JSON object from a resultSet .
  • Creates a deep copy of the given object .
  • Compares two objects .
  • Returns the type of this property .
  • Gets the class .
  • Returns the hash code for the given object instance .
  • Returns true if this map is mutable .
  • Disassociates the given object .
  • Assembles the conversion of an object .

pgjson Key Features

postgres json type support for hibernate.

pgjson examples and code snippets

  • How to use

How to use

        <dependency>
            <groupId>com.bazarnazar</groupId>
            <artifactId>pgjson</artifactId>
            <version>1.3</version>
        </dependency>

COMMUNITY DISCUSSIONS

Top Trending Discussions on pgjson
  • Slick PostgreSQL Integration
Top Trending Discussions on pgjson

QUESTION

Slick PostgreSQL Integration

Asked 2020-Jul-30 at 09:19

I'm new to scala and I'm trying to integrate a PostgreSQL database to a Lagom application written in scala.I'm trying to utilise the persistence API of Lagom. Lagom has inbuilt support for slick.

My table has 3 fields id of type int, name of type string, data of type jsonb

Since Slick doesn't support json format I'm trying to use slick-pg .

Below is my implementation

My custom profile class

import com.github.tminglei.slickpg.{ExPostgresProfile, PgPlayJsonSupport}
import play.api.libs.json.JsValue
import slick.basic.Capability
import slick.jdbc.{JdbcCapabilities, PostgresProfile}

trait CustomPostgresProfile extends ExPostgresProfile with PgPlayJsonSupport {
  def pgjson = "jsonb"

  override protected def computeCapabilities: Set[Capability] =
    super.computeCapabilities + JdbcCapabilities.insertOrUpdate

  override val api = PostgresJsonSupportAPI

  object PostgresJsonSupportAPI extends API with JsonImplicits {}
}

object CustomPostgresProfile extends PostgresProfile

My table definition

import com.custom.persistence.profile.CustomPostgresProfile.api._
import play.api.libs.json._


case class CustomDataEntity(id:int,name: String, data: JsValue)

object CustomDataTableDef {
  val data = TableQuery[CustomDataTableDef]
}
class CustomDataTableDef(tag: Tag) extends Table[CustomDataEntity](tag, "custom"){
  

  def id = column[Int]("id", O.PrimaryKey)

  def name = column[String]("name")
  def data = column[JsValue]("data")

  override def * =
    (id,name,data) <> (CustomDataEntity.tupled,CustomDataEntity.unapply(_))

}

when I'm trying to compile the code, I get the below 2 errors

could not find implicit value for parameter tt: slick.ast.TypedType[play.api.libs.json.JsValue]
[error]   def data = column[JsValue]("data")

Cannot resolve symbol <>

Please help me to resolve this

ANSWER

Answered 2020-Jul-27 at 09:59

Your object CustomPostgresProfile extends PostgresProfile instead of CustomPostgresProfile. If you fix that, it works.

Source https://stackoverflow.com/questions/63109364

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

VULNERABILITIES

No vulnerabilities reported

INSTALL pgjson

You can use pgjson like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the pgjson component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

SUPPORT

This projects provide some classes to simplify work with Postgres json data type in hibernate. It includes extended postgres dialect and objects for type def support. This small library allows to store in json field both HashMap(with any nesting level) and custom objects. Also it supports scheme validation and update.

Implement pgjson faster with kandi.

  • Use the support, quality, security, license, reuse scores and reviewed functions to confirm the fit for your project.
  • Use the, Q & A, Installation and Support guides to implement faster.

Discover Millions of Libraries and
Pre-built Use Cases on kandi