JDO support for "like" operator - jdo

I am learning JDO. I am using it with an sql database. I see no example talking about the common sql "like" operator.
It seems there is no "like operator for compatibility with non sql databases.
I need it. How can I do with JDO?
I add that I am using Datanucleus version 4 as JDO implementation because I am using Apache Isis. It seems that "matches" is implemented only in version 5.

JDOQL supports methods on objects, and follows Java syntax. Consequently it supports String.matches, providing regular expression matching. See the JDO spec and this link in the DataNucleus docs

With datanucleus resolved by Isis 1.15 (core 4.1.1, jdo-query 4.0.5, and so on) I can use "matches" inside a query defined as a string. But I cannot use it in a TypesafeQuery, the StringExpression has no method called "matches".

Related

Call java function using XQuery in MarkLogic

Is it possible to call java function using XQuery in MarkLogic. ?
Please refer - https://stackoverflow.com/questions/65953901/calling-java-method-from-xquery
Example -
declare namespace math="java:java.lang.Math";
math:sqrt(2)
There's no way to directly call a Java function from MarkLogic XQuery. If the Java code is accessible through a web service, you can use xdmp:http-get and similar.
As noted by Martin, depending on what functionality you're trying to access, you might not need to use Java.

how to create gremlin custom predicate in javascript

I am trying to create a Regex custom predicate for my query
I am seeing this can be done from the gremlin console as below
f = {x,y -> x ==~ y}
g.V().has('desc',test(f,/^Dal.*/)).values('desc')
however I am wondering how I can create custom predicate in a Javascript client?
I am using npm package (https://www.npmjs.com/package/gremlin) and Typescript.
The example you found works because when working with a local (embedded) graph such as a TinkerGraph you can essentially create custom classes and closures in Java and/or Groovy. You can think of this as extending Gremlin locally.
However, the Gremlin JavaScript client is designed to work with a remote graph. Many hosted graph providers limit or block entirely the use of such code for reasons of security. If you have control over the Gremlin Server you are connecting to or the provider you are using allows for closures/lambdas then you may be able to take advantage of that, see [1].
If you control the Gremlin Server you are using you could potentially just add the scripts that create the custom predicates there in the configuration files. For completeness to help others who find this post I included a link to the discussion on predicates that I believe you are referring to in your question [2].
[1] https://tinkerpop.apache.org/docs/current/reference/#gremlin-javascript-lambda
[2] http://www.kelvinlawrence.net/book/PracticalGremlin.html#pred

Migrating from Exist DB 2.1 to 5.x - Missing modules/functions

I'm in the process of migrating an Exist DB app based on 2.1 to 5.x and am having trouble finding replacements for a couple of apparently deprecated / moved functions. They are:
context:get-attribute
context:set-attribute
text:groups-regex
Any guidance on replacements or alternative approaches would be greatly appreciated.
Thanks.
The Context Module was removed in eXist-db 5.0.0 as its only purpose was to allow mutable variable storage within a single running XQuery. This is really just bad-practice, instead your XQuery should be refactored to pass variables around.
Instead of text:groups-regex, you probably want fn:analyze-string.

IdentityServer4.Services.InMemory not working

I google a lot but not find any solution. Below is my problem :
I make a simple project where I use reference "IdentityServer4.Postgresql": "1.0.0"
where "using IdentityServer4.Services.InMemory" works perfectly.
But when I use "IdentityServer4.Postgresql": "2.0.0" then IdentityServer4.Services.InMemory always shows error.
That means version 2 of IdentityServer4.Postgresql not support IdentityServer4.Services.InMemory.
How can I use IdentityServer4.Services.InMemory for "IdentityServer4.Postgresql": "2.0.0"?
Thanks in advance.
IdentityServer4.Postgresql is not a part of the IdentityServer project, but sounds like a community contribution. You may have a better result by contacting the library creator.
Otherwise, you could try the official IdentityServer4.EntityFramework package that is maintained by the IdentityServer team in combination with an Entity Framework Core database provider for PostgreSQL.
The official quickstarts only show adding Entity Framework in the 8th quickstart. You'll have to do each one in succession up to the eighth one to fully understand / make sure to have the code you need.
After you have Entity Framework added to the configuration, you can support a Postgres database by just adding dependencies.

SAP NetWeaver 7 trial and .NET connector 3.0 - available functions?

I am using the .NET Connector 3.0 to connect to some NetWeaver instance running on another machine. It all works nice, but the tutorial only connects to one function called STFC_CONNECTION. To do this, I am using this code:
function = destination.Repository.CreateFunction("STFC_CONNECTION");
Problem is, how do I know what other functions I can call? I there an overview of the available functions and return values? I have a login for the SAP site, so thats not a problem.
Thanks :)
If you want to know all function that can be called, you can check the table TFDIR with parameter FMODE ='R' (for Remote) using transaction se16. However, this will clearly be far too much info, since there is no explanation of what the functions do, or how they relat to each others.
another possibility is to use the BAPI transaction to get info on disponible operation by functionnal area.
Last, if you know some functions that interest you, you can search for function with the same prefix, or inportant part (ie INFTY for HR for exemple) using transaction se37. Please note that in this case, returned function can be inaccessible by RFC : you will have to check in the function's properties if the execution type is 'Remote'.
Regards
Guillaume
You'll need access to the SAP system using the SAP GUI, otherwise you won't be able to read the documentation. Use the transaction SE80 / Repository Explorer to search for function modules. Clicking on the + button will extend the selection screen. In the additional selection options, make sure to select only RFC-enabled function modules.
EDIT: Also check out this question...
I figured it out ... just type SE37 as transaction and use a filter in the search box like STFC_* and it will find all the functions including the parameters and return values.
The description at Consuming SAP XI Web Service with Microsoft Visual C# 2008 Express Edition provides a sample worked example for Visual Studio 2008.
SAP support either the RFC stack (SOAP, WSDL, UDDI) or the direct .NET Connector.
There is also the bapi explorer transaction "BAPI" who will show you the BAPI functions divided into functional areas.

Resources