No announcement yet.
  • Filter
  • Time
Clear All
new posts

  • SmartGwt 6.1 Pro - a simple question related to DataSource and criteria (lessThan/greaterThan), and maybe also a simple answer :)

    I have a license for SmartGwt 6.1p.
    How can I use a normal condition in a DataSource file, eg a date field or number is smaller or smaller than some value made on the database server's side?
    For some reason you have decided that these are advanced criteria and the Pro license prevents their use, although I consider them as basic ...
    I am not able to purchase a higher license, so I would be grateful for information or an example of what I need to handle and which methods to use to fulfill the above condition in DataSource using Hibernate.

    In the case of data validation, I can write my own method, eg checking the ID's uniqueness using DMI, can I do the same with the lessThan / greaterThan criterion? If so, how do I pass parameters (field name, operator, value to compare) to my own method? Can I use DMI for this or do I have to write my own DAO ?.
    Something tells me that I will have to support DAO methods in my own way, but the problem is still how to define the search parameters in the DataSoure file and then pick them up on the server side.


  • #2
    A Pro license will serialize AdvancedCriteria from the client and turn it into a server-side AdvancedCriteria object available from the DSRequest, so that you can implement filtering yourself. What a Pro license will not do is implement those AdvancedCriteria against databases/Hibernate/JPA, with all of the other related features: paging and sorting and transactions and aggregation and joins and other features, and of course workarounds for various database/JPA/Hibernate bugs and quirks.

    If you want to implement your own system for AdvancedCriteria, there are a lot of different ways to do it depending on how often AdvancedCriteria are used. If use of advanced operators is rare, you could separate out the advanced part of the criteria and apply the filtering it in Java (in a DMI or custom DataSource) after the framework has already done the filtering that is included in a Pro license. You could also implement your own implementation of AdvancedCriteria from scratch.

    Ultimately, to decide to implement your own version of AdvancedCriteria or other Power features on top of a Pro license, you have to value your time as worth very, very little. The Pro license principally exists for those who have pre-existing systems they are forced to integrate with, hence they cannot use the features of the Power license.