This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CogitoKnowledgeHelper synthesis = doc.getDocHelper().getKnowledgeHelper("AGU-Concept Set"); | |
if (synthesis != null) { | |
synthesis.getDescriptors(d -> d.getType().startsWith("/ConceptPath/Entity/GeoAge")) | |
.stream() | |
.forEach(d -> { | |
d.addAttribute("taxonomyIdDD", "aaaaaaaa7777777"); | |
}); | |
synthesis.getDescriptors(d -> d.getType().startsWith("/ConceptPath/Entity/Location")) | |
.stream() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence | |
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" | |
version="2.1"> | |
<persistence-unit name="blogPU" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<properties> | |
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/tweet?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" /> | |
<property name="javax.persistence.jdbc.user" value="super_admin" /> | |
<property name="javax.persistence.jdbc.password" value="super_admin" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import pw.osin.example.model.Tweet; | |
import javax.persistence.EntityManager; | |
import javax.persistence.Persistence; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.TypedQuery; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import javax.persistence.EntityManager; | |
import javax.persistence.Persistence; | |
public enum PersistenceHolder { | |
INSTANCE; | |
private EntityManager entityManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Tweet> findByQuery(String query) { | |
final TypedQuery<Tweet> typedQuery = getEntityManager().createNamedQuery(Tweet.FIND_BY_QUERY, Tweet.class); | |
typedQuery.setParameter("query", query); | |
return typedQuery.getResultList(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.model; | |
import javax.persistence.*; | |
@NamedQueries({ | |
@NamedQuery(name = Tweet.FIND_BY_QUERY, query = "SELECT tweet FROM Tweet tweet WHERE LOWER(tweet.text) LIKE CONCAT('%', LOWER(:query) , '%')") | |
}) | |
@Entity | |
public class Tweet { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import pw.osin.example.model.Tweet; | |
import javax.persistence.EntityManager; | |
import javax.persistence.Persistence; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.TypedQuery; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import pw.osin.example.model.Tweet; | |
import javax.persistence.EntityManager; | |
public class TweetRepositoryImpl extends AbstractJPADataAccess<Long, Tweet> implements TweetRepository { | |
protected EntityManager getEntityManager() { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import pw.osin.example.model.Tweet; | |
public interface TweetRepository extends DataAccess<Long, Tweet> { | |
Tweet findByQuery(String query); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.data; | |
import javax.persistence.EntityManager; | |
import javax.persistence.EntityTransaction; | |
import javax.persistence.TypedQuery; | |
import java.util.Collection; | |
import java.util.List; | |
public abstract class AbstractJPADataAccess<TKey, TEntity> implements DataAccess<TKey, TEntity> { |