Code Monkey home page Code Monkey logo

jpa-nestedset's People

Contributors

docdoc avatar florianschmitt avatar gboldrin avatar justintarthur avatar romanb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jpa-nestedset's Issues

NestedSet & Play! framework model

I've tried to use JPANestedset which seems great and perfectly respond to my need but Play! model uses long ID and NodeInfo int ID..... I'm not a Java GURU and I don't know workaround to inherit from Play model & implement NodeInfo in the same time ...

But, is an int ID enough ? Should not a long better suitable for this need ?

PS: great work & many thanks
PSPS: sorry for my english :-(

JPQLException : EntityTypeNotFound

JPQLException : If you specify the name of the entity the queries are not created correctly because it uses the name of the class.
I created a fork of the repository and I solved the problem


Example:

@entity(name="CAT")
public class Category implements NodeInfo {
@id @GeneratedValue
private int id;
private String name;
...
}

Exception Description: Error compiling the query [update Category n set n.lft = n.lft + ?1 where n.lft >= ?2 and n.rootId = ?4], line 1, column 0: Unknown entity type [Category].
at
...
org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.jaCaused by: Exception [EclipseLink-8037](Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Error compiling the query [update Category n set n.lft = n.lft + ?1 where n.lft >= ?2 and n.rootId = ?4], line 1, column 0: Unknown entity type [Category].
at org.eclipse.persistence.exceptions.JPQLException.entityTypeNotFound2(JPQLException.
at org.eclipse.persistence.internal.jpa.parsing.ModifyNode.resolveClass(ModifyNode.java:103)
...

org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found '.'

I get an error when I use node.getDescendants():

org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found '.' near line 1, column 125 [select generatedAlias0 from com.builder.ws.domain.ProductGroup as generatedAlias0 where ( ( cast(generatedAlias0.lft as java.lang.Number)>1 ) and ( cast(generatedAlias0.rgt as java.lang.Number)<6 ) ) and ( generatedAlias0.rootId=0 ) order by generatedAlias0.lft asc]

also I get an error when using Node.getParent():
org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found '.' near line 1, column 127 [select generatedAlias0 from com.builder.ws.domain.ProductGroup as generatedAlias0 where ( ( ( cast(generatedAlias0.lft as java.lang.Number)>1 ) and ( cast(generatedAlias0.rgt as java.lang.Number)<8 ) ) and ( cast(generatedAlias0.level as java.lang.Number)<=1 ) ) and ( generatedAlias0.rootId=0 ) order by generatedAlias0.lft asc]

Node.addChild works however.

No readme

This repo needs a readme file with some quick-start guide, because now we need to dig into code to understand how to use it.

Move as root

How I can move a child as a new root (on clear the child parent reference)?

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.