`
文章列表
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing:   这主要是在ManyToOne级联操作时遇到,比如new了一个新对象,在未保存之前将它保存进了一个新new的对象(也即不是持久态)。 解决办法是在保存或更新之前把这个对象查出来(这样就是一个持久态)。 解决办法是将many-to-one的级联设为: cascade="save-update,persis ...
public final static Date addMonths(final Date date, final Integer noOfMonths) { Calendar orgCal = GregorianCalendar.getInstance(); orgCal.setTime(date); Calendar newCal = GregorianCalendar.getInstance(); newCal.setTime(date); newCal.set(Calendar.DAY_OF_MONTH, 1); int year = orgCal. ...

valid date

    博客分类:
  • java
  public final static boolean isValidDate(final String date, final String format) { boolean result = false; try{ Date d = toDate(date, format); String s = DateFormatUtil.format(d, format); result = s.equals(date); } catch (Exception ex) { } return result; } publi ...
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.shkco.adsr3.cbm.vo.CustomerAccountInfo#74225]   at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:2523) at org. ...
java.lang.ClassCastException: [Ljava.lang.Object; incompatible with com.shkco.adsr3.cbm.vo.ICustomerAccount   看到这错误都知道是数据类型转换不匹配,Object 与ICustomerAccount.   DAO 方法原始如下: public List<ICustomerAccount> getListOfCustomerAccount(ISessionContext sessionContext, IClientCentricCustomer clientCen ...
The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitiv ...
当Maven项目很大,或者你运行诸如 mvn site 这样的命令的时候,maven运行需要很大的内存,在默认配置下,就可能遇到java的堆溢出 exception:OutOfMemoryError   set  MAVEN_OPTS=-Xms256m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=384m ANT_OPTS=-Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m   Windows # Go into your Control Panel > System > Ad ...
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)   当在进行操作时,当前version版本与DB中version版本不一致; 有其他用户对当前数据进行了操作。
Undefined Error: org.hibernate.HibernateException: identifier of an instance of com.shkco.adsr3.staticdata.vo.ClientGroup was altered from 2 to null   List<IClientGroup> clientGroupList = clientGroupService.getAllClientGroup(sessionContext); boolean clientGroupValidate = true; if(cl ...
Caused by: org.hibernate.AssertionFailure: collection owner not associated with session   [13/01/16 11:14:47:779 CST] 00000127 SystemErr R Caused by: org.hibernate.AssertionFailure: collection owner not associated with session: com.shkco.adsr3.cbm.vo.SubAccount.authorizors [13/01/16 11:14:47: ...
for(Iterator<IAddress> it=addSet.iterator();it.hasNext();){ IAddress address = it.next(); if(address.getId() != null){ Boolean flag = false; for(IAddress addr : set){ if(addr.getId().equals(address.getId())){ flag = true; break; } } if(!flag){ it.remove() ...
查询约束类型 select distinct constraint_type fromdba_constraints; Type Code Type Description Acts On Level C Check on a table Column O Read Only on a view Object P Primary Key Object R Referential AKA Foreign Key Column ...
SQL>set colsep' ';     //-域输出分隔符   SQL>set newp none            //设置查询出来的数据分多少页显示,如果需要连续的数据,中间不要出现空行就把newp设置为none,这样输出的数据行都是连续的,中间没有空行之类的   SQL>set echo off;     //显示start启动的脚本中的每个sql命令,缺省为on   SQL> set echo on               //设置运行命令是是否显示语句   SQL> set feedback on;       //设置显示“已选择 ...
查询锁表的Session  select sess.sid,     sess.serial#,     lo.oracle_username,     lo.os_user_name,     ao.object_name,     lo.locked_mode     from v$locked_object lo,     dba_objects ao,     v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid;   --杀死进程               ...
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.shkco.adsr3.frontoffice.omos.vo.OSEquOrder column: EXT_SYS_TYPE_ID (should be mapped with insert="false" update="false")   出现这个问题, 一般都是不同的属性映射了相同的字段,所以在hibernate配置文件中找EXT_SYS_TYPE_ID 就可以了,结果这个 ...
Global site tag (gtag.js) - Google Analytics