Giter Club home page Giter Club logo

Comments (18)

mdbs99 avatar mdbs99 commented on July 19, 2024

If you want to validate table columns -- using Greyhound broker -- you can use Constraints.
See: https://github.com/mdbs99/Greyhound/blob/master/examples/table/t1.pas#L111

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Yes, i know, but the idea is to persist a tobject, the method "validate" is only an example, can be any method. :)

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

Sorry, I don't get it, what would .Validate() do?

from brookframework.

mdbs99 avatar mdbs99 commented on July 19, 2024

Yes, i know, but the idea is to persist a tobject, the method "validate" is only an example, can be any method. :)

Persist a TObject? This is not possible... only if you use a subclass of TPersistent class and published properties.
Would be better if you explain what you want to do.

from brookframework.

waldirpaim avatar waldirpaim commented on July 19, 2024

Marcos da certo sim.
Estamos querendo converter TObject para JSON por RTTI, com isso aplicar na tabela o TObject direto.

English by google translator.
Mark's right yes.
We are trying to convert JSON to TObject for RTTI, apply it on the table with the direct TObject.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Sorry, I don't get it, what would .Validate() do?

Validate() is only a sample. I'll make a full demo to explain better my idea, that seems like "marshal" of Delphi: serialize and persists TObjects.

from brookframework.

mdbs99 avatar mdbs99 commented on July 19, 2024

For this you need TPersistent or use {$M+} directive on your classes that will be persisted

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

For this you need TPersistent or use {$M+} directive on your classes that will be persisted

No. I'll show it, wait please...

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Hello buddies,

This is my initial idea:

http://brookframework.org/todo/xuxa-20130124-1442.zip

See it working:

1 - http://imagebin.org/244061;
2 - http://imagebin.org/244062; (UTF-8 is very nice too! ;) )

I.e, I will use my objects, their properties and methods, after, simply I serialize and persist it. This is my idea. ;)

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

Hmm... does that mean the method should insert/update the object to data storage automatically?

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Yes. My doubt now is if I implement it direct in TBrookQuery or in a class helper.

ps. Update the field "weight" to "Numeric(9,2)", and in your browser, type "79,5" or "79.5", it allows comma or dot.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

I sent a question to the FPC-Devel:

http://lists.freepascal.org/lists/fpc-devel/2013-January/031003.html

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Michael implemented my suggestion about case insensitive en FPJSONRTTI: http://bugs.freepascal.org/view.php?id=23745.

from brookframework.

mdbs99 avatar mdbs99 commented on July 19, 2024

Hmm... I confuse me, sorry.
Well, the FPJSONRTTI unit (TJSONStreamer and TJSONDeStreamer classes) is doing the real job.
IHMO, the user can use it by themselves. Why put this in Brook?

But if you want anyway, do not put in BrookQuery.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Well, the reason is the same as having a TBrookQuery, even the user already having a TSQLQuery.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

I think that I'll implement it in a class helper, then your use will be optional. Or, creating a new unit: BrookRTTIDBAction. And this unit would have some new implementations.

from brookframework.

mdbs99 avatar mdbs99 commented on July 19, 2024

Ok, feel free.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Done. (b0f49c3)

from brookframework.

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.