X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fexception%2FManyObjectsForFunctionalRelationExceptionImpl.java;h=eb7630fa4ab0c2fc622e15b76aaf2a7b0a04ff7e;hp=2cb2e6a4cb92d3390e855b55d0c69edf08619013;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/exception/ManyObjectsForFunctionalRelationExceptionImpl.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/exception/ManyObjectsForFunctionalRelationExceptionImpl.java index 2cb2e6a4c..eb7630fa4 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/exception/ManyObjectsForFunctionalRelationExceptionImpl.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/exception/ManyObjectsForFunctionalRelationExceptionImpl.java @@ -1,39 +1,39 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.impl.exception; - -import org.simantics.databoard.Bindings; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.exception.ManyObjectsForFunctionalRelationException; -import org.simantics.db.impl.ResourceImpl; -import org.simantics.db.impl.graph.ReadGraphImpl; -import org.simantics.db.impl.support.ResourceSupport; -import org.simantics.layer0.Layer0; - -public class ManyObjectsForFunctionalRelationExceptionImpl extends ManyObjectsForFunctionalRelationException { - - private static final long serialVersionUID = 804263533707864050L; - - static String name(ReadGraphImpl graph, int subject) throws DatabaseException { - Layer0 b = Layer0.getInstance(graph); - ResourceSupport support = graph.getService(ResourceSupport.class); - Resource r = new ResourceImpl(support, subject); - String name = graph.getPossibleRelatedValue(r, b.HasName, Bindings.STRING); - return name; - } - - public ManyObjectsForFunctionalRelationExceptionImpl(ReadGraphImpl graph, ManyObjectsForFunctionalRelationException source) throws DatabaseException { - super("subject='" + name(graph, source.getIndex(0)) + "'"); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.impl.exception; + +import org.simantics.databoard.Bindings; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.exception.ManyObjectsForFunctionalRelationException; +import org.simantics.db.impl.ResourceImpl; +import org.simantics.db.impl.graph.ReadGraphImpl; +import org.simantics.db.impl.support.ResourceSupport; +import org.simantics.layer0.Layer0; + +public class ManyObjectsForFunctionalRelationExceptionImpl extends ManyObjectsForFunctionalRelationException { + + private static final long serialVersionUID = 804263533707864050L; + + static String name(ReadGraphImpl graph, int subject) throws DatabaseException { + Layer0 b = Layer0.getInstance(graph); + ResourceSupport support = graph.getService(ResourceSupport.class); + Resource r = new ResourceImpl(support, subject); + String name = graph.getPossibleRelatedValue(r, b.HasName, Bindings.STRING); + return name; + } + + public ManyObjectsForFunctionalRelationExceptionImpl(ReadGraphImpl graph, ManyObjectsForFunctionalRelationException source) throws DatabaseException { + super("subject='" + name(graph, source.getIndex(0)) + "'"); + } + +}