All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.boot.InvalidMappingException Maven / Gradle / Ivy

There is a newer version: 6.6.2.Final
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.boot;

import org.hibernate.boot.jaxb.Origin;

/**
 * Indicates a problem parsing the mapping document at a given {@link Origin}.
 *
 * @author Brett Meyer
 */
public class InvalidMappingException extends org.hibernate.InvalidMappingException {
	private final Origin origin;

	public InvalidMappingException(Origin origin) {
		super(
				String.format( "Could not parse mapping document: %s (%s)", origin.getName(), origin.getType() ),
				origin
		);
		this.origin = origin;
	}

	public InvalidMappingException(Origin origin, Throwable e) {
		super(
				String.format( "Could not parse mapping document: %s (%s)", origin.getName(), origin.getType() ),
				origin.getType().getLegacyTypeText(),
				origin.getName(),
				e
		);
		this.origin = origin;
	}

	public Origin getOrigin() {
		return origin;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy