javax.persistence.MapKeyJoinColumn Java Examples

The following examples show how to use javax.persistence.MapKeyJoinColumn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JPAOverriddenAnnotationReader.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
private MapKeyJoinColumn[] getMapKeyJoinColumns(Element element) {
	List<Element> subelements = element != null ? element.elements( "map-key-join-column" ) : null;
	List<MapKeyJoinColumn> joinColumns = new ArrayList<>();
	if ( subelements != null ) {
		for ( Element subelement : subelements ) {
			AnnotationDescriptor column = new AnnotationDescriptor( MapKeyJoinColumn.class );
			copyStringAttribute( column, subelement, "name", false );
			copyStringAttribute( column, subelement, "referenced-column-name", false );
			copyBooleanAttribute( column, subelement, "unique" );
			copyBooleanAttribute( column, subelement, "nullable" );
			copyBooleanAttribute( column, subelement, "insertable" );
			copyBooleanAttribute( column, subelement, "updatable" );
			copyStringAttribute( column, subelement, "column-definition", false );
			copyStringAttribute( column, subelement, "table", false );
			joinColumns.add( AnnotationFactory.create( column ) );
		}
	}
	return joinColumns.toArray( new MapKeyJoinColumn[joinColumns.size()] );
}
 
Example #2
Source File: JPAOverriddenAnnotationReader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void buildMapKeyJoinColumns(List<Annotation> annotationList, Element element) {
	MapKeyJoinColumn[] joinColumns = getMapKeyJoinColumns( element );
	if ( joinColumns.length > 0 ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyJoinColumns.class );
		ad.setValue( "value", joinColumns );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
Example #3
Source File: MapBinder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private javax.persistence.ForeignKey getMapKeyForeignKey(XProperty property) {
	final MapKeyJoinColumns mapKeyJoinColumns = property.getAnnotation( MapKeyJoinColumns.class );
	if ( mapKeyJoinColumns != null ) {
		return mapKeyJoinColumns.foreignKey();
	}
	else {
		final MapKeyJoinColumn mapKeyJoinColumn = property.getAnnotation( MapKeyJoinColumn.class );
		if ( mapKeyJoinColumn != null ) {
			return mapKeyJoinColumn.foreignKey();
		}
	}
	return null;
}
 
Example #4
Source File: MapKeyJoinColumnDelegator.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public MapKeyJoinColumnDelegator(MapKeyJoinColumn column) {
	this.column = column;
}