Skip to content

Instantly share code, notes, and snippets.

View Eugeny's full-sized avatar

Eugene Eugeny

View GitHub Profile
Message msg = new Message();
msg.setAuthor(author);
msg.setText(text);
msg.setIsDeleted(false);
GregorianCalendar cal = new GregorianCalendar();
cal.setTimeInMillis(System.currentTimeMillis());
msg.setSentTime(cal.getTime());
messageDao.create(msg);
14:01:25,028 WARN JDBCExceptionReporter:100 - SQL Error: -407, SQLState: 23502
14:01:25,028 ERROR JDBCExceptionReporter:101 - DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=17, COLNO=3, DRIVER=3.53.95
Exception in thread "main" org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: could not insert: [fksis.domain.entities.Message]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert: [fksis.domain.entities.Message]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:311)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:369)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
at org.springframework.dao.sup
package fksis.domain.entities;
import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;
/**
* The persistent class for the MESSAGE database table.
import types
class Target (object):
def A(self):
print 'in A'
def newfun(self):
print 'in B'
import java.text.ParseException;
import java.text.SimpleDateFormat;
public final class test {
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd HH:mm:ss yyyy");
try {
sdf.parse("Apr 21 09:37:04 2011");
} catch (ParseException e) {
Writer w = SUFS.writeFile("/data/tempfile");
try {
w.stream.writeChars("A\nB\nC\n");
} catch (IOException e) {
e.printStackTrace();
}
w.finish();
public final class SUFS {
# Root logger option
log4j.rootLogger=info, stdout
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.file=c:\\FKSIS_Messaging_Portlet.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.conversionPattern=%d{ABSOLUTE} %5p %t %c{1}:%M:%L - %m%n
log4j.appender.file.MaxFileSize=1024KB
log4j.appender.file.MaxBackupIndex=10
>>> d = datetime.datetime.utcfromtimestamp(0)
>>> time.mktime(d.utctimetuple()) - time.timezone
-3600.0
.block-content {
width: 960px;
margin: auto;
}
.block-content-right {
float: right;
width: 960px;
}
Root<Student> studentr = cq.from(Student.class);
cq.select(studentr);
cq.where(cb.like(studentr.get(Student_.groupNumber).as(String.class), like));
cq.groupBy(studentr.get(Student_.groupNumber));
cq.distinct(true);
13:11:34,499 ERROR PARSER:56 - line 1:136: expecting CLOSE, found '('
13:11:34,546 WARN HqlParser:249 - processEqualityExpression() : No expression to process!