Giter VIP home page Giter VIP logo

nativecriteria's Introduction

nativecriteria's People

Contributors

dependabot[bot] avatar groestl avatar nowakp1 avatar pnowy 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nativecriteria's Issues

Question about Hibernate requirement

Hi - sorry to log this as an issue, this is just a question. In the README it says "without any other generated classed based on database schema". Do you mean that it does not require JPA classes or hibernate.cfg.xml? I am looking for something like that.

Support embedded objects on NativeBeanPropertyMapper

It would be good to add support on NativeBeanPropertyMapper for embedded objects.

Let's assume that we have the class ProductDTO with embedded class Category. Currently we could map only simple types. Bean property mapper could fill the categoryId on ProductDTO but doesn't create the category object and fill id inside Category.

This ticket has been created in order to add that kind of support.

We could use specific notation for this in out aliases, something like that:

c.id as category$id

in order to parser know that object should be created.

Misleading projection definitions

Marked projection definitions could be misleading. Due to breaking changes of version 3 it would be good to reconsider the projection definitions approach:

image

Union/Union All

Hi,
is there a way to use UNION or UNION ALL between two NativeQueries? I have looked on the source code and didn't found.

Thank you!

Mixed parameter strategies error

Hello,

I have found a bug in expressions. NativeNotLikeExp, NativeNotILikeExp. They don`t use varName variable. As a result I am getting error
javax.persistence.PersistenceException: org.hibernate.engine.query.ParameterRecognitionException: Mixed parameter strategies - use just one of named, positional or JPA-ordinal strategy

How to use NativeCriteria on this sql?

Hi

I'm not sure how to use NativeCriteria to form the FROM clause for the sql statement below:

SELECT 
    productID,
    productName,
    categoryName,
    companyName AS supplier
FROM
    products
INNER JOIN
    categories ON categories.categoryID = products.categoryID
INNER JOIN
    suppliers ON suppliers.supplierID = products.supplierID

Is there a test case or something which I can refer to ?

Thanks

I have a pair of question...

  1. Is it possible to get value from a column of type blob in mysql DB?
  2. Is the limit clause working for MySql DB?

Add ILike expression

ublic class NativeILikeExp implements NativeExp {
    private String columnName;
    private String varName;
    private String value;

    /**
     * @param columnName the column name
     * @param value      the value
     */
    public NativeILikeExp(String columnName, String value) {
        if (Strings.isBlank(columnName))
            throw new IllegalStateException("columnName is null!");
        if (Strings.isBlank(value))
            throw new IllegalStateException("value is null!");

        this.columnName = columnName;
        this.value = value;
    }

    @OverRide
    public String toSQL() {
        varName = VarGenerator.gen(columnName).toLowerCase();
        return columnName + " ILIKE :" + varName;
    }

    @OverRide
    public void setValues(NativeQuery query) {
        query.setString(varName, value);
    }
}

How to perform ORDER BY NEWID()

Hi

May I know how to construct a sql as below?

SELECT * FROM aTable ORDER BY NEWID()

I tried to use NativeOrderExps but notice that it didn't take in a sql expression.

Thanks
Ian Lim

How to form a TOP select statement ?

NativeCriteria version = 2.0

Intend to form a statement = select top 100 col1, col2 from tableA

Using

NativeExps.customSql( "TOP 100")

or

NativeExps.sql( "TOP 100" )

will result in an extra comma:

select top 100, col1, col2 from tableA

Insensitive like with lowercase

Create native expression which use lowercase(column) to like search. Sometimes it is useful, especially when database does not support ILIKE expression.

Nested queries

Hi!
Is that possible to use nested queries in NativeCriteria? Tried to find this issue in your library but failed :(

edit: Somehow missed addSubqueryProjection method but failed to find how to remove the task not to close it.

Add the CTE support

Add the support for custom Common Table Expressions and check how it works with createNativeSqlQuery from hibernate session.

Add separate test groups for PostgreSQL

Consider to add the additional spring profile on nativeCriteria-test module which will run the test on the PostgreSQL db on demand in order to check whether it works correctly.

Boolean retrieving at CriteriaResultImpl

There is a bug on the CriteriaResultImpl#getBoolean in case of the situation when db value is instance of Boolean. There should be additional checking whether value is instance of Boolean (not only the integer and String).

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.