Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_pt
CreateManager_pt
LeftMenu




JSPWiki v2.2.33

[RSS]


Hide Menu

CreateDAO_pt


Difference between version 21 and version 20:

At line 187 changed 3 lines.
# Create your POJO (in the model directory) and <a href="#ref-CreateDAO-5">configure the mapping file</a> in applicationContext-hibernate.xml.
# cd into the ''extras/appgen'' directory and run "ant -Dobject.name=Person -Dappgen.type=pojo". In this example, the __Person__ class should exist in your "model" package. This generates all the files you create in the tutorials on this site (for your chosen web framework).
# To install the generated files, run "ant install". You can run "ant install -Dmodel.name=Person -Dmodel.name.lowercase=person" if you want to do everything in one fell swoop. __WARNING:__ You might want to backup your project before you do this - or at least make sure it's checked into a source code repository. I've tested this code, and I think it works well - but it ''is'' modifying your source tree for you.
# Crie seu POJO (no diretório model) e <a href="#ref-CreateDAO-5">configure o arquivo de mapeamento</a> in applicationContext-hibernate.xml.
# cd dentro do ''extras/appgen'' diretório e execute "ant -Dobject.name=Person -Dappgen.type=pojo". Neste exemplo, a __Person__ classe deve existir em seu pacote "model". Isto gera todos os arquivos que você criou no tutoriais neste site (para sua framework web de escolha).
# Para instalar os arquivos gerados, execute "ant install". Você pode executar "ant install -Dmodel.name=Person -Dmodel.name.lowercase=person" se você desejar fazer tudo de uma única vez. __WARNING:__ Você deveria fazer backup de seu projeto antes executar esta opção - ou pelo menos ter certeza que ele foi gravado no seu repositório de código fonte. Eu testei este código, e penso que funciona bem - mas ele ''está'' modificanco a árvore de código-fonte para você.
At line 191 changed 1 line.
The reason for the "lowercase" parameter is to rename the JSPs to begin with a lowercase letter. If I tried to rename them and change the filename programmatically, it took 1MB worth of BSF and Rhino JARs (+5 lines of code) and this just seemed easier. Speaking of JSPs - it's up to you to modify the *Form.jsp and make it look pretty. This is covered in Step 5 of each respective web framework's "Create Action/Controller" tutorial: <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=CreateActions#ref-CreateAction-5">Struts</a>, <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=SpringControllers#ref-SpringControllers-5">Spring</a> and <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=WebWorkActions#ref-WebWorkActions-5">WebWork</a>.
A razão para o "lowercase" parâmetro é renomear as JSPs para começar com uma letra minúscula. Se eu tentasse renomá-los e alter o nome de arquivo programaticamente, levaria 1MB a importância da BSF e Rhino JARs (+5 linhas de código) e desta forma me pareceu mais fácil. Falando de JSPs - depende de você modificar o *Form.jsp e fazê-lo paracer melhor. Isto abrangido no passo 5 de cada respectiva framework web "Create Action/Controller" tutorial: <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=CreateActions#ref-CreateAction-5">Struts</a>, <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=SpringControllers#ref-SpringControllers-5">Spring</a> and <a href="http://raibledesigns.com/wiki/Wiki.jsp?page=WebWorkActions#ref-WebWorkActions-5">WebWork</a>.
At line 193 changed 1 line.
__NOTE:__ If you'd like to generate all the DAOs/Managers/Tests, run "ant install-detailed" instead of "ant install". Before you install anything, the files will be created in the extras/appgen/build/gen directory (in case you want to look at them before installing). If you just want to test the tool, you can cd to this directory and run "ant test" to see the contents of these tutorials created.
__NOTE:__ Se você quizer gerar tudo DAOs/Managers/Tests, execute "ant install-detailed" no lugar de "ant install". Antes de você instalar tudo, os arquivos serão criados no extras/appgen/build/gen diretório (em caso de você querer dar uma olhada antes de instalar). Se você somente quizer testar a ferramenta, você pode cd para este diretório e executar "ant test" para vê o conteúdo destes tutoriais criados.
At line 195 changed 1 line.
I encourage you to read these tutorials even if you decide to generate all your code. That way you'll understand what's being generated for you and you'll only need to mailing list for [asking smart questions|http://www.catb.org/~esr/faqs/smart-questions.html]. ;-) Hopefully this tool will remove the pain of writing simple CRUD code and let you concentrate on developing your business logic and fancy UIs!</div>
Eu o encorago a ler estes tutorias mesmo se você decidir gerar todo seu código. Desta forma você irá entender o que está sendo gerado para você e somente precisará das lista de usuários para [perguntando questões inteligentes|http://www.catb.org/~esr/faqs/smart-questions.html]. ;-) Espero que esta ferramenta irá remover o sofrimento de escrever simples código CRUD e deixar você concentrar no desenvolvimento de suas regras/lógica de negócio e UIs especiais!</div>

Back to CreateDAO_pt, or to the Page History.