@@ -2561,13 +2561,11 @@ public static Pair<String, GUID> getURICacheKey(DomainDescriptor dd)
25612561 return getCacheKey (dd .getDomainURI (), dd .getContainer ());
25622562 }
25632563
2564-
25652564 public static Pair <String , GUID > getCacheKey (PropertyDescriptor pd )
25662565 {
25672566 return getCacheKey (pd .getPropertyURI (), pd .getContainer ());
25682567 }
25692568
2570-
25712569 public static Pair <String , GUID > getCacheKey (String uri , Container c )
25722570 {
25732571 Container proj = c .getProject ();
@@ -2661,7 +2659,6 @@ public static PropertyDescriptor insertOrUpdatePropertyDescriptor(PropertyDescri
26612659 }
26622660 }
26632661
2664-
26652662 static final String parameters = "propertyuri,name,description,rangeuri,concepturi,label," +
26662663 "format,container,project,lookupcontainer,lookupschema,lookupquery,defaultvaluetype,hidden," +
26672664 "mvenabled,importaliases,url,urltarget,shownininsertview,showninupdateview,shownindetailsview,measure,dimension,scale," +
@@ -2704,71 +2701,6 @@ else if ("propertyuri".equals(p))
27042701 return new ParameterMapStatement (t .getSchema ().getScope (), conn , sql , null );
27052702 }
27062703
2707- static ParameterMapStatement getUpdateStmt (Connection conn , User user , TableInfo t ) throws SQLException
2708- {
2709- user = null ==user ? User .guest : user ;
2710- SQLFragment sql = new SQLFragment ("UPDATE exp.propertydescriptor SET " );
2711- ColumnInfo c ;
2712- String comma = "" ;
2713- for (var p : parametersArray )
2714- {
2715- if (null == (c = t .getColumn (p )))
2716- continue ;
2717- sql .append (comma ).append (p ).append ("=?" );
2718- comma = ", " ;
2719- sql .add (new Parameter (p , c .getJdbcType ()));
2720- }
2721- sql .append (", modifiedby=" + user .getUserId () + ", modified={fn now()}" );
2722- sql .append ("\n WHERE propertyid=?" );
2723- sql .add (new Parameter ("propertyid" , JdbcType .INTEGER ));
2724- return new ParameterMapStatement (t .getSchema ().getScope (), conn , sql , null );
2725- }
2726-
2727-
2728- public static void insertPropertyDescriptors (User user , List <PropertyDescriptor > pds ) throws SQLException
2729- {
2730- if (null == pds || pds .isEmpty ())
2731- return ;
2732- TableInfo t = getTinfoPropertyDescriptor ();
2733- try (Connection conn = t .getSchema ().getScope ().getConnection ();
2734- ParameterMapStatement stmt = getInsertStmt (conn , user , t , false ))
2735- {
2736- ObjectFactory <PropertyDescriptor > f = ObjectFactory .Registry .getFactory (PropertyDescriptor .class );
2737- Map <String , Object > m = null ;
2738- for (PropertyDescriptor pd : pds )
2739- {
2740- m = f .toMap (pd , m );
2741- stmt .clearParameters ();
2742- stmt .putAll (m );
2743- stmt .addBatch ();
2744- }
2745- stmt .executeBatch ();
2746- }
2747- }
2748-
2749-
2750- public static void updatePropertyDescriptors (User user , List <PropertyDescriptor > pds ) throws SQLException
2751- {
2752- if (null == pds || pds .isEmpty ())
2753- return ;
2754- TableInfo t = getTinfoPropertyDescriptor ();
2755- try (Connection conn = t .getSchema ().getScope ().getConnection ();
2756- ParameterMapStatement stmt = getUpdateStmt (conn , user , t ))
2757- {
2758- ObjectFactory <PropertyDescriptor > f = ObjectFactory .Registry .getFactory (PropertyDescriptor .class );
2759- Map <String , Object > m = null ;
2760- for (PropertyDescriptor pd : pds )
2761- {
2762- m = f .toMap (pd , m );
2763- stmt .clearParameters ();
2764- stmt .putAll (m );
2765- stmt .addBatch ();
2766- }
2767- stmt .executeBatch ();
2768- }
2769- }
2770-
2771-
27722704 public static PropertyDescriptor insertPropertyDescriptor (PropertyDescriptor pd ) throws ChangePropertyDescriptorException
27732705 {
27742706 assert pd .getPropertyId () == 0 ;
@@ -2779,7 +2711,6 @@ public static PropertyDescriptor insertPropertyDescriptor(PropertyDescriptor pd)
27792711 return pd ;
27802712 }
27812713
2782-
27832714 //todo: we automatically update a pd to the last one in?
27842715 public static PropertyDescriptor updatePropertyDescriptor (PropertyDescriptor pd )
27852716 {
0 commit comments