From e368bfaeaf8c9d161a0d14a3fefee532a17d467c Mon Sep 17 00:00:00 2001 From: Ihar Hancharenka Date: Sun, 20 Aug 2023 22:14:04 +0300 Subject: [PATCH] m --- .../tools/ide/vscode/ext/pl/java/java.txt | 25 +- .../tools/ide/vscode/ext/sql/code-mssql.txt | 10 + .../tools/ide/vscode/features/cfg/cfg.txt | 1 + .../tools/ide/vscode/features/cfg/font.txt | 4 + .../tools/ide/vscode/features/code-keys.txt | 4 + .../orm/hibernate/docs/whatsnew.txt | 2 + .../orm/hibernate/features/internals/src.txt | 279 ++++++++++++++++++ .../spring/data/jpa/features/audit-envers.txt | 2 + pl/java/libfws/spring/redis.txt | 2 + .../js/libfws/ui/visual/graph/litegraph.txt | 1 + 10 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 pl/cross/tools/ide/vscode/ext/sql/code-mssql.txt create mode 100644 pl/java/libfws/io/persistence/orm/hibernate/features/internals/src.txt create mode 100644 pl/web/js/libfws/ui/visual/graph/litegraph.txt diff --git a/pl/cross/tools/ide/vscode/ext/pl/java/java.txt b/pl/cross/tools/ide/vscode/ext/pl/java/java.txt index 6b7d1c245..616103531 100644 --- a/pl/cross/tools/ide/vscode/ext/pl/java/java.txt +++ b/pl/cross/tools/ide/vscode/ext/pl/java/java.txt @@ -1,4 +1,28 @@ +https://code.visualstudio.com/docs/languages/java +https://code.visualstudio.com/docs/java/java-editing + !!! a lot of usefull props + +https://marketplace.visualstudio.com/items?itemName=redhat.java + lombok support +https://marketplace.visualstudio.com/items?itemName=vmware.vscode-boot-dev-pack +https://marketplace.visualstudio.com/items?itemName=vmware.vscode-spring-boot + https://github.com/spring-projects/sts4/tree/main/vscode-extensions/vscode-spring-boot#usage + https://github.com/spring-projects/sts4 + https://code.visualstudio.com/docs/java/java-spring-boot + +https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle + +settings.json +{ + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable", + "java.compile.nullAnalysis.mode": "disabled" +} + +??? https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack + ? ms-based +https://github.com/redhat-developer/vscode-java + https://marketplace.visualstudio.com/items?itemName=pverest.java-ide-pack https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-boot-dev-pack @@ -6,7 +30,6 @@ https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-boot-dev-pack https://code.visualstudio.com/docs/languages/java https://code.visualstudio.com/docs/java/java-tutorial -https://github.com/redhat-developer/vscode-java https://github.com/microsoft/vscode-java-debug https://github.com/microsoft/vscode-java-debug/wiki/Hot-Code-Replace diff --git a/pl/cross/tools/ide/vscode/ext/sql/code-mssql.txt b/pl/cross/tools/ide/vscode/ext/sql/code-mssql.txt new file mode 100644 index 000000000..9376e727e --- /dev/null +++ b/pl/cross/tools/ide/vscode/ext/sql/code-mssql.txt @@ -0,0 +1,10 @@ +https://github.com/microsoft/vscode-mssql +https://learn.microsoft.com/en-us/sql/tools/visual-studio-code/sql-server-develop-use-vscode + +Installing SQL tools service to + ~/.vscode/extensions/ms-mssql.mssql-1.20.1/sqltoolsservice/4.8.1.2/Ubuntu16 +downloading + https://github.com/Microsoft/sqltoolsservice/releases/download/4.8.1.2/microsoft.sqltools.servicelayer-rhel-x64-net7.0.tar.gz + +snippets + sqlCreateDatabase diff --git a/pl/cross/tools/ide/vscode/features/cfg/cfg.txt b/pl/cross/tools/ide/vscode/features/cfg/cfg.txt index beaa800e6..7f61fd517 100644 --- a/pl/cross/tools/ide/vscode/features/cfg/cfg.txt +++ b/pl/cross/tools/ide/vscode/features/cfg/cfg.txt @@ -1,6 +1,7 @@ https://code.visualstudio.com/docs/getstarted/settings cfg: +~/.config/Code/User/settings.json https://code.visualstudio.com/docs/customization/userandworkspace C:/Users/<>/AppData/Roaming/Code/ User/ diff --git a/pl/cross/tools/ide/vscode/features/cfg/font.txt b/pl/cross/tools/ide/vscode/features/cfg/font.txt index f4e204136..0f59b40c5 100644 --- a/pl/cross/tools/ide/vscode/features/cfg/font.txt +++ b/pl/cross/tools/ide/vscode/features/cfg/font.txt @@ -1,5 +1,6 @@ https://fonts.google.com/?selection.family=Source+Code+Pro // Place your settings in this file to overwrite the default settings + { "editor.fontSize": 18 "editor.fontFamily": "SourceCodePro-Medium", @@ -11,6 +12,9 @@ https://fonts.google.com/?selection.family=Source+Code+Pro "editor.fontLigatures": true, } +Explorer font size + "window.zoomLevel": 1.5 + Change Background Color I use the dark theme (View > Theme > Dark theme). diff --git a/pl/cross/tools/ide/vscode/features/code-keys.txt b/pl/cross/tools/ide/vscode/features/code-keys.txt index c456fce10..a81b7f295 100644 --- a/pl/cross/tools/ide/vscode/features/code-keys.txt +++ b/pl/cross/tools/ide/vscode/features/code-keys.txt @@ -10,6 +10,10 @@ F10 F11 Step Into +C-P + Open file +C-T + Open class C+S+P Command Palette diff --git a/pl/java/libfws/io/persistence/orm/hibernate/docs/whatsnew.txt b/pl/java/libfws/io/persistence/orm/hibernate/docs/whatsnew.txt index f65f3c1c7..7bf4e0fd1 100644 --- a/pl/java/libfws/io/persistence/orm/hibernate/docs/whatsnew.txt +++ b/pl/java/libfws/io/persistence/orm/hibernate/docs/whatsnew.txt @@ -1,4 +1,6 @@ 2023 +Mihalcea + https://www.youtube.com/watch?v=DY7BUOmtL0c https://habr.com/ru/companies/naumen/articles/708244/ 2022 https://thorben-janssen.com/migrating-to-hibernate-6/ diff --git a/pl/java/libfws/io/persistence/orm/hibernate/features/internals/src.txt b/pl/java/libfws/io/persistence/orm/hibernate/features/internals/src.txt new file mode 100644 index 000000000..a7454050a --- /dev/null +++ b/pl/java/libfws/io/persistence/orm/hibernate/features/internals/src.txt @@ -0,0 +1,279 @@ +LOG.tracev + AbstractEntityPersister + DefaultFlushEntityEventListener + + +https://thorben-janssen.com/flushmode-in-jpa-and-hibernate/ + DefaultFlushEventListener + DefaultFlushEntityEventListener - too often callled + EntityUpdateAction -> good place for BP setting + +https://github.com/stsypanov/dirty-checking-examples/blob/master/benchmarks/src/main/java/com/luxoft/logeek/benchmark/dirtychecking/hibernate/SimpleDirtyCheckingBenchmark.java + entity.$$_hibernate_getDirtyAttributes(); + + +SessionEventListener + +org.hibernate + cfg + AvailableSettings + tons of settings const-s + event + spi + ... + DefaultFlushEntityEventListener { + protected void dirtyCheck(final FlushEntityEvent event) throws HibernateException { + ... + if ( dirtyCheckPossible ) { + // dirty check against the usual snapshot of the entity + dirtyProperties = persister.findDirty( values, loadedState, entity, session ); + } + ... + logDirtyProperties + } + ... + private void logDirtyProperties(Serializable id, int[] dirtyProperties, EntityPersister persister) { + ... + LOG.tracev( + "Found dirty properties [{0}] : {1}", + MessageHelper.infoString( persister.getEntityName(), id ), + Arrays.toString( dirtyPropertyNames ) + + + ); + } + } + + RefreshEventListener + ReplicateEventListener + ResolveNaturalIdEventListener + SaveOrUpdateEventListener + + public final class EventType { + public static final EventType LOAD = create( "load", LoadEventListener.class ); + public static final EventType RESOLVE_NATURAL_ID = create( "resolve-natural-id", ResolveNaturalIdEventListener.class ); + + public static final EventType INIT_COLLECTION = create( "load-collection", InitializeCollectionEventListener.class ); + + public static final EventType SAVE_UPDATE = create( "save-update", SaveOrUpdateEventListener.class ); + public static final EventType UPDATE = create( "update", SaveOrUpdateEventListener.class ); + public static final EventType SAVE = create( "save", SaveOrUpdateEventListener.class ); + ... + } + + internal + AbstractSaveEventListener + saveWithRequestedId() + saveWithGeneratedId() + performSave + + public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener ... { + onSaveOrUpdate + performSaveOrUpdate + entityIsTransied + saveWithGeneratedId + calls AbstractSaveEventListener.performSave + } + + public class DefaultDirtyCheckEventListener extends AbstractFlushingEventListener implements DirtyCheckEventListener { + } + + +org.hibernate.internal + public abstract class AbstractSharedSessionContract implements SharedSessionContractImplementor { + private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( SessionImpl.class ); + ... + } + + FastSessionServices { + public final EventListenerGroup eventListenerGroup_AUTO_FLUSH; + public final EventListenerGroup eventListenerGroup_CLEAR; + public final EventListenerGroup eventListenerGroup_DELETE; + public final EventListenerGroup eventListenerGroup_DIRTY_CHECK; + public final EventListenerGroup eventListenerGroup_EVICT; + ... + FastSessionServices(SessionFactoryImpl sf) { + Objects.requireNonNull( sf ); + final ServiceRegistryImplementor sr = sf.getServiceRegistry(); + ... + // Pre-compute all iterators on Event listeners: + final EventListenerRegistry eventListenerRegistry = sr.getService( EventListenerRegistry.class ); + ... + } + ... + } + + SessionImpl extends AbstractSharedSessionContract { + ... + fastSessionServices.eventListenerGroup_NAME.fireLazyEvent...(...) + + @Override + public EntityPersister getEntityPersister(final String entityName, final Object object) { + checkOpenOrWaitingForAutoClose(); + if ( entityName == null ) { + return getFactory().getMetamodel().entityPersister( guessEntityName( object ) ); + } + else { + ... + return getFactory().getMetamodel().entityPersister( entityName ) + .getSubclassEntityPersister( object, getFactory() ); + } + } + + // saveOrUpdate() operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @Override + public void saveOrUpdate(Object object) throws HibernateException { + saveOrUpdate( null, object ); + } + ... + // save() operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ... + @Override + public boolean isDirty() throws HibernateException { + checkOpen(); + pulseTransactionCoordinator(); + log.debug( "Checking session dirtiness" ); + if ( actionQueue.areInsertionsOrDeletionsQueued() ) { + log.debug( "Session dirty (scheduled updates and insertions)" ); + return true; + } + DirtyCheckEvent event = new DirtyCheckEvent( this ); + fastSessionServices.eventListenerGroup_DIRTY_CHECK.fireEventOnEachListener( event, DirtyCheckEventListener::onDirtyCheck ); + delayedAfterCompletion(); + return event.isDirty(); + } + } + +org.hibernate + boot.internal + public class MetadataImpl implements MetadataImplementor, Serializable { + + +collection.internal + AbstractPersistentCollection { + isDirty() + + @Override + boolean equalsSnapshot() { + ... + if ( oldValue == null || elementType.isDirty( oldValue, test, getSession() ) ) { + } + } + } + +type + https://docs.jboss.org/hibernate/orm/5.6/javadocs/org/hibernate/type/package-summary.html + + public interface Type extends Serializable { + + boolean isDirty(Object old, Object current, SharedSessionContractImplementor session) throws HibernateException { + + } + } + OneToOneType + ManyToOneType + getIdentifierType.isSame(...) + CollectionType + ComponentType + @Override + public boolean isDirty(final Object x, final Object y, final SharedSessionContractImplementor session) throws HibernateException { + if ( x == y ) { + return false; + } + // null value and empty component are considered equivalent + for ( int i = 0; i < propertySpan; i++ ) { + if ( propertyTypes[i].isDirty( getPropertyValue( x, i ), getPropertyValue( y, i ), session ) ) { + return true; + } + } + return false; + } + + + AbstractType + AbstractStandardBasicType + dirty () { + !isSame + } + + public abstract class EntityType extends AbstractType implements AssociationType { + } + +persister.entity + interface EntityPersister { + } + + AbstractEntityPersister { + protected final BasicEntityPropertyMapping propertyMapping; + ... + + @Override + public int[] resolveDirtyAttributeIndexes( + final Object[] currentState, + final Object[] previousState, + final String[] attributeNames, + final SessionImplementor session) { + ... + } + + public int[] findDirty(Object[] currentState, Object[] previousState, Object entity, SharedSessionContractImplementor session) throws HibernateException { + TypeHelper... + } + } + + TypeHelper { + @Override + public static int[] findDirty( + final NonIdentifierAttribute[] properties, + final Object[] currentState, + final Object[] previousState, + final boolean[][] includeColumns, + final SharedSessionContractImplementor session) { + } + } + + SingleTableEntityPersister, JoinedSubclassEntityPersister, ... for test + +persister.internal + + public class StandardPersisterClassResolver implements PersisterClassResolver { + + @Override + public Class getEntityPersisterClass(PersistentClass metadata) { + // todo : make sure this is based on an attribute kept on the metamodel in the new code, not the concrete PersistentClass impl found! + if ( RootClass.class.isInstance( metadata ) ) { + if ( metadata.hasSubclasses() ) { + //If the class has children, we need to find of which kind + metadata = (PersistentClass) metadata.getDirectSubclasses().next(); + } + else { + return singleTableEntityPersister(); + } + } + if ( JoinedSubclass.class.isInstance( metadata ) ) { + return joinedSubclassEntityPersister(); + } + else if ( UnionSubclass.class.isInstance( metadata ) ) { + return unionSubclassEntityPersister(); + } + else if ( SingleTableSubclass.class.isInstance( metadata ) ) { + return singleTableEntityPersister(); + } + } + } + + public final class PersisterFactoryImpl implements PersisterFactory, ServiceRegistryAwareService { + @Override + public EntityPersister createEntityPersister( + PersistentClass entityBinding, + EntityDataAccess entityCacheAccessStrategy, + NaturalIdDataAccess naturalIdCacheAccessStrategy, + PersisterCreationContext creationContext) throws HibernateException { + ... + // called by MetamodelImpl + public class MetamodelImpl implements MetamodelImplementor, Serializable { + public void initialize(MetadataImplementor mappingMetadata, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting) { + } + } + } + } diff --git a/pl/java/libfws/spring/data/jpa/features/audit-envers.txt b/pl/java/libfws/spring/data/jpa/features/audit-envers.txt index 98b27f9cb..343a37911 100644 --- a/pl/java/libfws/spring/data/jpa/features/audit-envers.txt +++ b/pl/java/libfws/spring/data/jpa/features/audit-envers.txt @@ -13,3 +13,5 @@ https://habr.com/ru/post/715918/ 2022 https://www.baeldung.com/database-auditing-jpa https://www.baeldung.com/spring-data-jpa-method-in-all-repositories +2014 +https://habr.com/ru/articles/238487/ diff --git a/pl/java/libfws/spring/redis.txt b/pl/java/libfws/spring/redis.txt index 0726294ea..24624dcb8 100644 --- a/pl/java/libfws/spring/redis.txt +++ b/pl/java/libfws/spring/redis.txt @@ -1,3 +1,5 @@ 2023 https://www.baeldung.com/spring-boot-redis-cache https://www.baeldung.com/spring-data-redis-properties +2020 +https://habr.com/ru/articles/517246/ diff --git a/pl/web/js/libfws/ui/visual/graph/litegraph.txt b/pl/web/js/libfws/ui/visual/graph/litegraph.txt new file mode 100644 index 000000000..527b714f9 --- /dev/null +++ b/pl/web/js/libfws/ui/visual/graph/litegraph.txt @@ -0,0 +1 @@ +https://github.com/jagenjo/litegraph.js