mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
HHH-7919 : Miscellaneous bugfixes
This commit is contained in:
parent
cc6d271f31
commit
082e6b7e18
@ -92,6 +92,11 @@ else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY ) ) {
|
||||
// need to wait until the ID or attribute source can be resolved.
|
||||
indexSource = null;
|
||||
}
|
||||
else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY_CLASS ) ) {
|
||||
// can be anything
|
||||
throw new NotYetImplementedException( "@MapKeyClass is not supported yet." );
|
||||
}
|
||||
//TODO the map attribute may contains both {@code MAP_KEY_COLUMN} and {@code MAP_KEY_CLASS}
|
||||
else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY_COLUMN ) ) {
|
||||
final Binder.DefaultNamingStrategy defaultNamingStrategy = new Binder.DefaultNamingStrategy() {
|
||||
@Override
|
||||
@ -109,10 +114,6 @@ else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY_TEMPORAL ) )
|
||||
// basic
|
||||
throw new NotYetImplementedException( "@MapKeyTemporal is not supported yet." );
|
||||
}
|
||||
else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY_CLASS ) ) {
|
||||
// can be anything
|
||||
throw new NotYetImplementedException( "@MapKeyClass is not supported yet." );
|
||||
}
|
||||
else if ( attribute.annotations().containsKey( JPADotNames.MAP_KEY_JOIN_COLUMN ) ) {
|
||||
// association
|
||||
throw new NotYetImplementedException( "@MapKeyJoinColumn is not supported yet." );
|
||||
|
@ -488,7 +488,7 @@ private void createMappedAttribute(Member member, AccessType accessType) {
|
||||
getLocalBindingContext()
|
||||
);
|
||||
Class<?> collectionIndexType = null;
|
||||
if ( Map.class.isAssignableFrom( attributeType ) ) {
|
||||
if ( Map.class.isAssignableFrom( attributeType ) && !resolvedMember.getType().getTypeParameters().isEmpty()) {
|
||||
collectionIndexType = resolvedMember.getType().getTypeParameters().get( 0 ).getErasedType();
|
||||
}
|
||||
MappedAttribute.Nature attributeNature = determineAttributeNature(
|
||||
|
@ -272,7 +272,7 @@ name, target, toArray( annotationValueList )
|
||||
}
|
||||
|
||||
static String buildSafeClassName(String className, String defaultPackageName) {
|
||||
if ( className.indexOf( '.' ) < 0 && StringHelper.isNotEmpty( defaultPackageName ) ) {
|
||||
if ( className!= null && className.indexOf( '.' ) < 0 && StringHelper.isNotEmpty( defaultPackageName ) ) {
|
||||
className = StringHelper.qualify( defaultPackageName, className );
|
||||
}
|
||||
return className;
|
||||
|
@ -50,7 +50,7 @@ protected PropertyElement getPropertyElement() {
|
||||
protected void processExtra() {
|
||||
List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
MockHelper.classValue(
|
||||
"targetEntity", oneToMany.getTargetEntity(), annotationValueList, indexBuilder.getServiceRegistry()
|
||||
"targetEntity", MockHelper.buildSafeClassName( oneToMany.getTargetEntity(), getDefaults().getPackageName() ), annotationValueList, indexBuilder.getServiceRegistry()
|
||||
);
|
||||
MockHelper.enumValue( "fetch", FETCH_TYPE, oneToMany.getFetch(), annotationValueList );
|
||||
MockHelper.stringValue( "mappedBy", oneToMany.getMappedBy(), annotationValueList );
|
||||
|
@ -23,7 +23,6 @@
|
||||
<column name="fld_id"/>
|
||||
<generated-value strategy="TABLE" generator="generator"/>
|
||||
</id>
|
||||
<basic name="unknownProperty"/>
|
||||
<many-to-one name="manufacturer" fetch="LAZY">
|
||||
<join-column name="manufacturer_pk"/>
|
||||
</many-to-one>
|
||||
|
Loading…
x
Reference in New Issue
Block a user