- 浏览: 28738 次
- 性别:
- 来自: 上海
最新评论
文章列表
Field[] fields = bean.getClass().getDeclaredFields();try { for (int i = 0; i < fields.length; i++) { Field f = fields[i]; // 设置些属性是可以访问的 f.setAccessible(true); logger.info(f.getName() + " - " + f.get(bean)); }} cat
1、父类:@Entity@Table(name = "tab_product")@Inheritance(strategy = InheritanceType.JOINED)2、子类@Entity@Table(name = "tab_cpa_product")@PrimaryKeyJoinColumn(name
System.out.println("+++++++++++++++++++++++++++++++++++++++++");String head = request.getHeader("Accept-Encoding");// 有些浏览器不支持压缩数据if (head.contains("gzip")) {// 输出压缩数据} else {// 输出不压缩数据
Timestamp ts = new Timestamp(System.currentTimeMillis());Date date = new Date(); try { date = ts; ystem.out.println(date);} catch (Exception e) { e.printStackTrace();}
/** * @param 要转换的毫秒数 * @return 该毫秒数转换为 * days * hours * minutes * seconds 后的格式 * @author fy.zhang */ public static String formatDuring(long mss) { long days = mss / (1000 * 60 * 60 * 24); long hours = (mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); long minutes = (mss % (1000 * ...
<bean id="initializeService" class="com.demo.impl.InitializeServiceImpl" lazy-init="false" init-method="initialize"> <property name="dataAccessor" ref="dataAccessor"/></bean>
@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = {"classpath:application-context.xml"})public abstract class SpringTestSupport {}
public static Role fromName(String name) { for (Role role : Role.values()) { if (StringUtils.equals(role.name(), name)) { return role; } } return null;}
<property name="bargainStatus"> <type name="org.hibernate.type.EnumType"> <param name="enumClass">com.demo.model.Bargain$Status</param> </type></property>
public String getClientIP(HttpServletRequest httpservletrequest) { if (httpservletrequest == null) return null; String s = httpservletrequest.getHeader("X-Forwarded-For"); if (s == null || s.length() == 0 || "unknown".equalsIgnoreCase(s)) s = httpse ...
1、下载链接:http://httpd.apache.org/download.cgi
sudo ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --host=amd64
make & make install
cp /usr/local/apache2/conf/httpd.conf /etc/apache2/httpd.conf
sudo apachectl restart
2、安装apr,a ...
查询主表:<resultMap type="com.demo.bean.WXGameRankingBean" id="weiboJoinAccountResultMap"> <id property="id" column="id" /> <result property="score" column="score" /> <result property="openid" ...
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?--> SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();int weekday = c.get(7) - 1;c.add(5, -weekday);System.out.println("JAVA-API,本周开始时间:" + sdf.f ...
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?--> Map<String, String> map = ...for (String key : map.keySet()) { System.out.println(key + map.get(key));}for (Map.Entry<String, String> entry : map.entrySet()) { System.out.println(entry.getK ...