Skip to content

Instantly share code, notes, and snippets.

View torstenwerner's full-sized avatar

Torsten Werner torstenwerner

View GitHub Profile
SELECT a1.*
FROM attribute a1
WHERE a1.Name = 'referencenumber' AND a1.value LIKE '%A123%';
SELECT a0.*
FROM attribute a0
WHERE a0.userid IN (
SELECT a1.userid
FROM attribute a1
WHERE a1.Name = 'referencenumber' AND a1.value LIKE '%A123%');
static void enableMetroDumps() {
// https://metro.java.net/guide/ch02.html#logging
// dumps encrypted transport messages
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
// dumps unencrypted/decrypted message before/after security tube's processing
System.setProperty("com.sun.xml.wss.provider.wsit.SecurityTubeFactory.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold", "100000");
}
@torstenwerner
torstenwerner / Scratch.java
Created April 3, 2018 15:46
sample jpa annotations
import javax.persistence.*;
@Entity
class Scratch {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
String a;
@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
at ...Delete...ServiceBeanImpl.delete...(Delete...ServiceBeanImpl.java:50)
at sun.reflect.GeneratedMethodAccessor1257.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:90)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:101)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
@torstenwerner
torstenwerner / oracle-update-returning.sql
Last active July 19, 2020 10:05
Oracle jdbc update with returning clause
declare
o0 dbms_sql.varchar2_table;
o1 dbms_sql.varchar2_table;
c0 sys_refcursor;
c1 sys_refcursor;
begin
update "C##TEST"."AUTHOR"
set "C##TEST"."AUTHOR"."FIRST_NAME" = ?
where "C##TEST"."AUTHOR"."LAST_NAME" = ?
returning "C##TEST"."AUTHOR"."FIRST_NAME", "C##TEST"."AUTHOR"."LAST_NAME" bulk collect into o0, o1;