Tabnine Logo
MappingException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.hibernate.MappingException
constructor

Best Java code snippets using org.hibernate.MappingException.<init> (Showing top 20 results out of 333)

origin: hibernate/hibernate-orm

public boolean isValid(Mapping mapping) throws MappingException {
  if ( referencedEntityName == null ) {
    throw new MappingException( "one to many association must specify the referenced entity" );
  }
  return true;
}
origin: hibernate/hibernate-orm

@Override
public CollectionPersister collectionPersister(String role) {
  final CollectionPersister persister = collectionPersisterMap.get( role );
  if ( persister == null ) {
    throw new MappingException( "Could not locate CollectionPersister for role : " + role );
  }
  return persister;
}
origin: hibernate/hibernate-orm

@Override
public EntityPersister entityPersister(String entityName) throws MappingException {
  EntityPersister result = entityPersisterMap.get( entityName );
  if ( result == null ) {
    throw new MappingException( "Unknown entity: " + entityName );
  }
  return result;
}
origin: hibernate/hibernate-orm

  @Override
  public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException {
    entityName = params.getProperty( ENTITY_NAME );
    if ( entityName == null ) {
      throw new MappingException("no entity name");
    }
  }
}
origin: hibernate/hibernate-orm

public String[] getColumnNames(String propertyName) {
  String[] cols = columnsByPropertyPath.get( propertyName );
  if ( cols == null ) {
    throw new MappingException( "unknown property: " + propertyName );
  }
  return cols;
}
origin: hibernate/hibernate-orm

void throwUnsupportedTypeException(Type type, String entityName, String propertyName) {
  final String message = "Type not supported for auditing: " + type.getClass().getName() +
      ", on entity " + entityName + ", property '" + propertyName + "'.";
  throw new MappingException( message );
}
origin: hibernate/hibernate-orm

public boolean isValid(Mapping mapping) throws MappingException {
  if (referencedEntityName==null) {
    throw new MappingException("association must specify the referenced entity");
  }
  return super.isValid( mapping );
}
origin: hibernate/hibernate-orm

/**
 * Because of the overridden {@link #getCreateSequenceString(String)}, we must also override
 * {@link #getCreateSequenceString(String, int, int)} to prevent 2 instances of "start with".
 */
@Override
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException {
  if ( supportsPooledSequences() ) {
    return "create sequence " + sequenceName + " start with " + initialValue + " increment by " + incrementSize;
  }
  throw new MappingException( getClass().getName() + " does not support pooled sequences" );
}
origin: hibernate/hibernate-orm

@Override
public String getSequenceNextValString(String sequenceName) {
  if ( supportsSequences() ) {
    return "values next value for " + sequenceName;
  }
  else {
    throw new MappingException( "Derby does not support sequence prior to release 10.6.1.0" );
  }
}
origin: hibernate/hibernate-orm

private SQLLoadable getSQLLoadable(String entityName) throws MappingException {
  EntityPersister persister = factory.getEntityPersister( entityName );
  if ( !(persister instanceof SQLLoadable) ) {
    throw new MappingException( "class persister is not SQLLoadable: " + entityName );
  }
  return (SQLLoadable) persister;
}
origin: hibernate/hibernate-orm

private void checkPropertyDuplication() throws MappingException {
  HashSet<String> names = new HashSet<>();
  Iterator iter = getPropertyIterator();
  while ( iter.hasNext() ) {
    Property prop = (Property) iter.next();
    if ( !names.add( prop.getName() ) ) {
      throw new MappingException( "Duplicate property mapping of " + prop.getName() + " found in " + getEntityName() );
    }
  }
}
origin: hibernate/hibernate-orm

public UniqueKey addUniqueKey(UniqueKey uniqueKey) {
  UniqueKey current = uniqueKeys.get( uniqueKey.getName() );
  if ( current != null ) {
    throw new MappingException( "UniqueKey " + uniqueKey.getName() + " already exists!" );
  }
  uniqueKeys.put( uniqueKey.getName(), uniqueKey );
  return uniqueKey;
}
origin: hibernate/hibernate-orm

@Override
public String getIdentifierPropertyName(String entityName) throws MappingException {
  final PersistentClass pc = entityBindingMap.get( entityName );
  if ( pc == null ) {
    throw new MappingException( "persistent class not known: " + entityName );
  }
  if ( !pc.hasIdentifierProperty() ) {
    return null;
  }
  return pc.getIdentifierProperty().getName();
}
origin: hibernate/hibernate-orm

  protected Type requireIdentifierOrUniqueKeyType(Mapping mapping) {
    final Type fkTargetType = getIdentifierOrUniqueKeyType( mapping );
    if ( fkTargetType == null ) {
      throw new MappingException(
          "Unable to determine FK target Type for many-to-one or one-to-one mapping: " +
              "referenced-entity-name=[" + getAssociatedEntityName() +
              "], referenced-entity-attribute-name=[" + getLHSPropertyName() + "]"
      );
    }
    return fkTargetType;
  }
}
origin: hibernate/hibernate-orm

@Override
public NativeQuery setResultSetMapping(String name) {
  ResultSetMappingDefinition mapping = getProducer().getFactory().getNamedQueryRepository().getResultSetMappingDefinition( name );
  if ( mapping == null ) {
    throw new MappingException( "Unknown SqlResultSetMapping [" + name + "]" );
  }
  NativeSQLQueryReturn[] returns = mapping.getQueryReturns();
  queryReturns.addAll( Arrays.asList( returns ) );
  return this;
}
origin: hibernate/hibernate-orm

private OuterJoinLoadable getOuterJoinLoadable(String entityName) throws MappingException {
  EntityPersister persister = getFactory().getMetamodel().entityPersister( entityName );
  if ( !( persister instanceof OuterJoinLoadable ) ) {
    throw new MappingException( "class persister is not OuterJoinLoadable: " + entityName );
  }
  return (OuterJoinLoadable) persister;
}
origin: hibernate/hibernate-orm

public Class getComponentClass() throws MappingException {
  final ClassLoaderService classLoaderService = getMetadata()
      .getMetadataBuildingOptions()
      .getServiceRegistry()
      .getService( ClassLoaderService.class );
  try {
    return classLoaderService.classForName( componentClassName );
  }
  catch (ClassLoadingException e) {
    throw new MappingException("component class not found: " + componentClassName, e);
  }
}
origin: hibernate/hibernate-orm

public void validate(Mapping mapping) throws MappingException {
  super.validate(mapping);
  if ( key!=null && !key.isValid(mapping) ) {
    throw new MappingException(
        "subclass key mapping has wrong number of columns: " +
        getEntityName() +
        " type: " +
        key.getType().getName()
      );
  }
}
origin: hibernate/hibernate-orm

public void validate(Mapping mapping) throws MappingException {
  super.validate(mapping);
  if ( key!=null && !key.isValid(mapping) ) {
    throw new MappingException(
      "subclass key mapping has wrong number of columns: " +
      getEntityName() +
      " type: " +
      key.getType().getName()
    );
  }
}

origin: hibernate/hibernate-orm

public void validate(Mapping mapping) throws MappingException {
  super.validate( mapping );
  assert getElement() != null : "IndexedCollection index not bound : " + getRole();
  if ( !getIndex().isValid(mapping) ) {
    throw new MappingException(
      "collection index mapping has wrong number of columns: " +
      getRole() +
      " type: " +
      getIndex().getType().getName()
    );
  }
}
org.hibernateMappingException<init>

Javadoc

Constructs a MappingException using the given information.

Popular methods of MappingException

  • getMessage
  • getCause
  • getStackTrace
  • setStackTrace

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now