How to favor exact matches in entity reference autocomplete?

Right now if you use entity reference autocomplete for short titles of a node type or entity type, and you have many items, due to the fact that by default they are ordered by entity id (nid), less relevant entries show up before exact matches.

For example, if you create a content type for stock symbols, and you have tens of thousands of them, and you want to search for “EA” or “DIS”, longer strings that contain these substrings show up before exact matches.

How can you change the behavior so exact matches show up before other matches with lower entity ids?

How to add new field to Node entity bundles

I want to add a new (SVG) icon to the Node entity so that I can specify a user editable icon per content type (not per node instance). I could then display the icon in various node templates.

I haven’t found anything concrete on how to best handle this. Is there a hook/plugin I can create to add a new field to the configuration page? If I add a new field via a form alter, where should I save this extra information?

Use custom template for custom entity in D8

I have created a custom entity via drupal console, and it created template item_entity.html.twig in template folder, but the entity is being rendered in some other way because any changes in template not work. How to figure out how this process works and to make it rendered through a custom template?

Entity definition:

* @ContentEntityType(  *   id = "item_entity",  *   label = @Translation("Item entity"),  *   handlers = {  *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",  *     "list_builder" = "Drupal\item\Utils\Item\ItemEntityListBuilder",  *     "views_data" = "Drupal\item\Entity\ItemEntityViewsData",  *     "translation" = "Drupal\item\Utils\Item\ItemEntityTranslationHandler", 


entity.item_entity.canonical:   path: '/item/{item_entity}'   defaults:   # Calls the view controller, defined in the annotation of the item entity     _entity_view: 'item_entity'     _title: 'Item Content'   requirements:   # Calls the access controller of the entity, $  operation 'view'     _entity_access: 'item_entity.view' 

In twig file data is rendered from:

<!-- BEGIN OUTPUT from 'core/themes/stable/templates/layout/region.html.twig' --> 

Springboot плагин для Eclipse строящий UML базы на основании Entity

День добрый, Есть сервлет написанный с использованием springboot с большим количеством классов, который не работает, причина в структуре БД,которая должна создаваться посредством hibernate, с помощью какого плагина для Eclipse, я могу визуализировать все Entity в uml для отладки сервлета.

Entity Refernce View Widget conflicting with Time Field?

am trying to setup a content type that has the need for both an Entity Reference Views Widget and also needs fields using Time Field (, however the ERVW does not work in the content type when there is also a Time Field. I have setup and tested the ERVW and it works properly in multiple content types for the site, however, once a Time Field is added to the content type the View Widget does not load when “add items” are clicked. Any help much appreciated! Site on drupal 7

Web Api не может конвертнуть объект Entity для формирования которого использовался Eager loading в Json

есть Модель EF введите сюда описание изображения

в репозитории производится Eager loading введите сюда описание изображения

Это все потом передаётся в контроллер через прослойку введите сюда описание изображения Все это возвращает следующий результат:введите сюда описание изображения и когда контроллер пытается его вернуть вылетает ошибка в браузеревведите сюда описание изображения в конфиге указал уже
GlobalConfiguration.Configuration.Formatters.Clear(); GlobalConfiguration.Configuration.Formatters.Add(new JsonMediaTypeFormatter());

Where are: Domain, Aggregate, Entity on the picture?

I’m studying Domain driven design (DDD), reading many articles, but never found a simple explanation. Please, help, let’s say we have a design:

enter image description here

My bunch of question is:

  1. What is domain? ( where is domain depicted) on this pic?
  2. Where is aggregate on the pic? ( is it many objects or only one?)
  3. Is it right that Order is the aggregate root?
  4. Why LineItem is not an entity? (i’m asking, because here: guys directly say that OrderLine is an entity
  5. Can DDD schema exists without CQRS? Should CQRS be applied to every part (domain? aggregate?) of the architecture
  6. Is Event Driven == Event sourcing?
  7. Is compensation required in DDD Event Driven/sourcing instead of distributed transactions, or can it be somehow exists without compensation (and without distributed transactions)?

I really googled and read articles, and these questions are raised in my head…

Retornar o menor valor usando o Entity Framework

Sou bastante inexperiente é verdade, mas criei coragem e vim aqui perguntar.. Estou preso há algumas horas em uma solução que aparentemente teria tudo pra ser simples, mas não consigo enxergar uma saída.

Eu tenho dois models, em um deles eu tenho a informação básica do produto (descrição, foto, etc) e no outro eu tenho informações específicas daquela embalagem, como quantidade na embalagem e preço.

Por exemplo:

Produto : Coca Cola 2 lts


UN:1 – 6,99

CX:12 – 83,88

Eu preciso fazer uma pesquisa que me retorne o menor preço das embalagens cadastradas por produto.

O SQL seria esse:


Normalmente eu poderia usar uma expressão do tipo

contexto.ProdutoEmbalagens.Min(c => c.Preco) 

No entanto, eu estou tentando trazer informações do produto também:

var produtos =                     (from prod in contexto.Produtos                      join emb in contexto.ProdutoEmbalagems on prod.Id equals emb.IdProduto                      where prod.IdEstabelecimento == idEstabelecimento                      select new                      {                          prod.Id,                          prod.Descricao,                          emb.Embalagem,                          emb.Quantidade,                          emb.Preco                      }).ToList(); 

Alguma ideia? Sei que certamente a solução é simples, mas já fritei a cabeça 🙁