I previously mentioned that I intended not to use any Java ORM frameworks. Eu que me referi anteriormente destinados a não utilizar qualquer Java ORM quadros. ORM frameworks I have seen so far have a steep learning curve and tend to shoe horn your architecture into their model. ORM quadros que eu vi até agora têm uma curva de aprendizado íngreme e tendem a buzina sapato em sua arquitetura seu modelo. So I started fresh without any ORM frameworks like Hibernate or Spring (which I have heard is better). Então eu comecei fresco, sem qualquer ORM quadros como Hibernate ou Primavera (que eu ouvi é melhor).

I am happy coding my queries in SQL and don’t need to use any ORM specific language like Hibernate OQL. Estou feliz codificação minhas consultas no SQL e não precisam de utilizar qualquer ORM língua específica como Hibernate OQL. SQL is best for what it does. SQL é melhor para o que faz. Why re-invent the wheel? Por que reinventar a roda? Also I like the fine-grained control over my database as I am processing very large amount of data. Eu também gosto de multa de grãos controle sobre a minha base como eu sou de transformação muito grande quantidade de dados. My experience will be primarily relevant to sql happy java developers. Minha experiência será principalmente relevante para sql feliz desenvolvedores Java.

In the process (of working without any ORM framework) I realized I just needed two simple facilities over plain old JDBC. No decorrer do processo (de trabalho, sem qualquer enquadramento ORM), percebi eu só preciso duas instalações mais simples planície velho JDBC.

1. I needed a way to put all the SQL queries and DDL’s in a separate file. Eu precisava de uma forma de colocar todas as consultas SQL e DDL's em um arquivo separado. This allows me or a DBA to later analyze the query with a fine tooth comb and optimize if necessary. Isto permite-me um DBA ou mais tarde a analisar a consulta com um pente fino dente e otimizar, se necessário. It also allows me to easily change them without changing the code. Também me permite alterar facilmente deles sem alterar o código. Most of all cleanliness of the solution is appealing. Acima de tudo, a solução de limpeza é atraente. At this point I am sure you are thinking of iBatis. Neste ponto, estou certo de que você está pensando iBatis. I tried iBatis. Tentei iBatis. Initially I liked it and thought I had my solution. Inicialmente eu pensei que eu gostava e que tinha a minha solução. However as I went down the lane I realized it too gave me features that I didn’t need. No entanto, tal como eu fui pressionada a faixa percebeu que eu também me deu as características que eu não precisava. Even this was more complicated than I needed. Mesmo este era mais complicada do que eu precisava. All I needed was a HashMap saved to a file in XML format. Tudo o que era necessário um HashMap guardados em um arquivo em formato XML. And my database class should support query execution by name (think key-value). E minha classe base devem apoiar a execução query nome (pense-chave valor).

2. Secondly I needed connection pooling to prevent opening and closing too many connections and also running out of connections. Em segundo lugar eu precisava conexão pooling para evitar abertura e fecho de muitas ligações e também ficar sem conexões. I found a nice solution in Proxool. Eu encontrei uma solução em Proxool agradável. Additionally it supports having multiple connection profiles in a simple text file and optionally logging queries. Além disso, ele suporta conexão com vários perfis em um arquivo texto simples e, opcionalmente, registrando buscas.

3. I needed to integrate these two capabilities in a simple database class along with utility methods like cleanly closing connection and optionally logging the query data. Eu necessária para a integração destas duas capacidades em um banco de dados simples classe junto com métodos como a utilidade limpa fechar conexão e, opcionalmente, registrando a consulta de dados.

That’s all there is in my super simple framework, if you can even call it that. Isso é tudo que existe no meu super simples quadro, se você pode até mesmo chamar-lhe isso. And, believe it or not, I am way more productive using it than I have been in a long time and I feel fully in control. E, creiam ou não, estou a maneira de usá-la mais produtiva do que tenho sido, em muito tempo e me sinto plenamente em controle. No more burden of shoe horning my ideas to fit FooBah framework and its ideologies for me. Não há mais carga de sapato horning minhas ideias para se ajustarem suas ideologias FooBah quadro e para mim.

Update: There has been extensive discussion on this post at the Update: Tem havido um debate aprofundado sobre este post no ServerSide .