Skip to content

Instantly share code, notes, and snippets.

View sebersole's full-sized avatar

Steve Ebersole sebersole

View GitHub Profile
Deadlock Detection:
No deadlocks found.
Thread 17740: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information may be imprecise)
- java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Compiled frame)
- java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Compiled frame)
- org.gradle.messaging.remote.internal.hub.queue.EndPointQueue.take(java.util.Collection) @bci=36, line=49 (Compiled frame)
- org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run() @bci=25, line=345 (Compiled frame)
idea {
module {
iml {
beforeMerged { module ->
module.dependencies.clear()
module.excludeFolders.clear()
}
whenMerged { module ->
module.dependencies*.exported = true
@sebersole
sebersole / EntityTypeMetadata
Last active August 29, 2015 13:57
Entity/MappedSuperclass - alternative
class EntityTypeMetadata extends IdentifiableTypeMetadata {
private MappedSuperclassTypeMetadata mappedSuperclass;
private EntityTypeMetadata superType;
...
}
Specifically here the phrase "is not recognized" is in question. In our opinion there are 2 problems with the JPA provider accepting such properties at the EntityManager level:
* Unnecessary growth of the map used to hold these properties
* Misleading feedback when/if EntityManager#getProperties() is later called (here it would look like some BV config is in use when it is not).
I understand that the wording in the javadoc makes what the TCK does allowable, but in my opinion the intent is incorrect and we ask that this be changed. There are other properties that actually have meaning at the EntityManager level that could be used to test this instead.
jar {
manifest = osgiManifest { manifest ->
classesDir = sourceSets.main.output.classesDir
classpath = configurations.runtime
instruction 'Bundle-Vendor', 'Hibernate.org'
OsgiManifestPackagingInfo.buildInfo( project ).applyTo( manifest )
instruction 'Implementation-Url', 'http://hibernate.org'
@Test
public void basicTest() {
// just making sure we can add one and that it is usable when we get it back
EntityManager em = getOrCreateEntityManager();
Query query = em.createQuery( "from Item" );
final String name = "myBasicItemQuery";
em.getEntityManagerFactory().addNamedQuery( name, query );
Query query2 = em.createNamedQuery( name );
@sebersole
sebersole / ClassPropertyHolder.java
Created September 5, 2013 04:25
In ClassPropertyHolder, I have the following code that is performed during construction...
protected Map<String, AttributeConversionInfo> buildAttributeConversionInfoMap(XClass entityXClass) {
final HashMap<String, AttributeConversionInfo> map = new HashMap<String, AttributeConversionInfo>();
collectAttributeConversionInfo( map, entityXClass );
return map;
}
protected void collectAttributeConversionInfo(Map<String, AttributeConversionInfo> infoMap, XClass xClass) {
if ( xClass == null ) {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
mavenCentral()
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
}
<xsd:complexType name="embedded">
<xsd:annotation>
<xsd:documentation>
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Embedded {}
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
@Embeddable
class Address {
...
@Convert(...) private String city;
}
@Entity
@Convert(attributeName="homeAddress.city", disableConversion=true)
class Person {