{"id":2299,"date":"2014-06-22T18:36:14","date_gmt":"2014-06-22T18:36:14","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=2299"},"modified":"2014-06-22T18:36:14","modified_gmt":"2014-06-22T18:36:14","slug":"fixing-odataolingo-error-find-entity-set-function-import-x","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/fixing-odataolingo-error-find-entity-set-function-import-x\/","title":{"rendered":"Fixing OData\/Olingo error: &#8220;Could not find an entity set or function import for &#8216;x&#8217;.&#8221;"},"content":{"rendered":"<p>Sometimes with Apache Olingo you see this error message:<\/p>\n<pre>\nCould not find an entity set or function import for 'my_table'.\n<\/pre>\n<p>The Olingo sample applications register types like so:<\/p>\n<pre lang=\"Java\">\nstatic final String \n  ENTITY_SET_NAME_CARS = \"Cars\";\n\nprivate static final \n  FullQualifiedName ENTITY_TYPE_1_1 = \n    new FullQualifiedName(\n      NAMESPACE, \n      ENTITY_NAME_CAR);\n\n...\n\nList<EntitySet> entitySets = \n  new ArrayList<EntitySet>();\n\nentitySets.add(\n  getEntitySet(\n    ENTITY_CONTAINER, \n    ENTITY_SET_NAME_CARS));\n<\/pre>\n<p>So, all you need to do to fix this error is to fill out these spots for your new type. To set up EntitySet you can do the following:<\/p>\n<pre lang=\"Java\">\nnew EntitySet()\n  .setName(name)\n  .setEntityType(\n    new FullQualifiedName(NAMESPACE, name)\n   )\n<\/pre>\n<p>Note that you may want to use different values for &#8216;setName&#8217; and &#8216;entityType&#8217; &#8211; in the sample apps they use the pluralized form in setName and the singular in entity type.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes with Apache Olingo you see this error message: Could not find an entity set or function import for &#8216;my_table&#8217;. The Olingo sample applications register types like so: static final String ENTITY_SET_NAME_CARS = &#8220;Cars&#8221;; private static final FullQualifiedName ENTITY_TYPE_1_1 = new FullQualifiedName( NAMESPACE, ENTITY_NAME_CAR); &#8230; List entitySets = new ArrayList(); entitySets.add( getEntitySet( ENTITY_CONTAINER, ENTITY_SET_NAME_CARS)); So, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/fixing-odataolingo-error-find-entity-set-function-import-x\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing OData\/Olingo error: &#8220;Could not find an entity set or function import for &#8216;x&#8217;.&#8221;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[398,399],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2299"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=2299"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2299\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=2299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=2299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=2299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}