This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(now()) - TO_DAYS(@dateofbirth)), '%Y') + 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//metodo para montagem do json que vai bater com a classe java | |
getDadosFormulario:function(){ | |
var vaga=[]; | |
//atentar para o fato de que o name deve ser igual ao nome do objeto passado como parametro e suas propriedades | |
vaga.push({name:"vaga.nome",value: $("#titulo").val()}); | |
vaga.push({name:"vaga.salario",value: $("#salario").val()}); | |
vaga.push({name:"vaga.local",value: $("#local").val()}); | |
vaga.push({name:"vaga.descricao",value: $("#descricao").val()}); | |
return vaga; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${pageContext.request.contextPath} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//hql | |
StringBuilder hql = new StringBuilder(""); | |
hql.append(" from Desenglobacao d where d.englobadaNumeroCota = :cotaId "); | |
Query query = getSession().createQuery(hql.toString()); | |
query.setParameter("cotaId", cotaId); | |
return query.list(); | |
//criteria | |
return getSession().createCriteria(Desenglobacao.class) | |
.add(Restrictions.eq("desenglobaNumeroCota", cotaId)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moeda:function(z){ | |
v = z.value; | |
v=v.replace(/\D/g,"") // permite digitar apenas numero | |
v=v.replace(/(\d{1})(\d{14})$/,"$1.$2") // coloca ponto antes dos ultimos digitos | |
v=v.replace(/(\d{1})(\d{11})$/,"$1.$2") // coloca ponto antes dos ultimos 11 digitos | |
v=v.replace(/(\d{1})(\d{8})$/,"$1.$2") // coloca ponto antes dos ultimos 8 digitos | |
v=v.replace(/(\d{1})(\d{5})$/,"$1.$2") // coloca ponto antes dos ultimos 5 digitos | |
v=v.replace(/(\d{1})(\d{1,2})$/,"$1,$2") // coloca virgula antes dos ultimos 2 digitos | |
z.value = v; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clearData = { | |
total: 0, | |
page:1, | |
rows: [] | |
}; | |
$("#grid").flexAddData(clearData); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -h 127.0.0.1 -u root -p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/mysql/my.cnf | |
lower_case_table_names=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<persistence-unit name="tramponaweb" transaction-type="JTA"> | |
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> | |
<jta-data-source>jdbc/tramponaweb</jta-data-source> | |
<exclude-unlisted-classes>false</exclude-unlisted-classes> | |
<properties> | |
<property name="eclipselink.logging.level" value="INFO"/> | |
<property name="eclipselink.target-database" value="MySQL"/> | |
<property name="eclipselink.profiler" value="NoProfiler"/> | |
<property name="eclipselink.logging.logger" value="JavaLogger"/> | |
</properties> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#id").keypress(function (e) { | |
//if the letter is not digit then display error and don't type anything | |
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) { | |
return false; | |
} | |
}); |
OlderNewer