- 浏览: 81028 次
- 性别:
- 来自: 北京
最新评论
文章列表
VO与PO之间相互转换
- 博客分类:
- Web开发
转换基类:
public abstract class BaseConverter<V, P> {
private static Logger logger = LoggerFactory.getLogger(BaseConverter.class);
/**
* 值对象与域对象之间属性复制
*
* @param dto
* 值对象
* @param domain
* 域对象
* @param flag
* ...
删除重复记录的高效SQL
- 博客分类:
- Web开发
删除重复记录的高效SQL:
delete from student pdi where pdi.rowid in
(select t1.rowid FROM student t1,
(select t.s_no, max(t.id) max_id from student t group by t.s_no having count(*) > 1) t2
where t1.s_no = t2.s_no and t1.id != t2.max_id)
toString 方法
- 博客分类:
- Java基础
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
Method[] methods = this.getClass().getMethods();
boolean isFirst = true;
for (int i = 0, n = methods.length; i < n; i++) {
try {
Method method = methods[i];
if ((method.getModifiers() & ...
ThinkPHP demo
- 博客分类:
- php
UserController.class.php
<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends CommonController {
public function listUser(){
$user = M('User');
$users = $user->limit(10)->select();
$this->assign('ulist',$users);
$this->display();
}
publi ...
input 字母大小写转换
- 博客分类:
- javascript
$("#textbox").bind('keyup', function (e) {
if (e.which >= 97 && e.which <= 122) {
var newKey = e.which - 32;
// I have tried setting those
e.keyCode = newKey;
e.charCode = newKey;
}
$("#textbox").val(($("#textbox&quo ...
http://www.softechallenger.com/download/?ISBN=978-7-121-15685-4
http://p.www.xiaomi.com/open/131219/book/hongmi.html?_v=12230111&n=0
Java 反射研究Demo
- 博客分类:
- Java基础
需要JDom.jar
package test;
import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.jdom2.Document;
import org.jdom2.Element;
import o ...
POM.XML
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
< ...
JMX with Spring
- 博客分类:
- JMX
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.s ...
JMX 与Tomcat 集成
- 博客分类:
- Web开发
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file= ...
maven demo
- 博客分类:
- maven
mvn test -Dmaven.test.failure.ignore=true -Dapp.properties.path=conf/area/sz -P profile-A
public class EncryptedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer {
private List<String> encryptPropertyNames;
@Override
protected String convertProperty(Strin ...
import java.util.Date;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.Message;
import org.springframework.integration.jms.JmsSendingMessageHandler;
im ...
import java.util.LinkedList;
import java.util.List;
import org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo;
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor;
public class DemoPersistenceUnitPostProcessor implements PersistenceUnitPostPro ...
spring data demo
- 博客分类:
- spring
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Seque ...