Btw i currently develop a custom repository so i can select summary data by using filter from API. During development i got an error:
Springboot version: 2.3.3.RELEASE
org.hibernate.hql.internal.ast.QuerySyntaxException: Transactions is not mapped [SELECT pl FROM Transactions pl]
my entity class:
@Data
@Entity
@Table(name = "transactions")
public class Transactions implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "trx_amt")
private BigDecimal trxAmt;
}
my repository:
@RepositoryRestResource(collectionResourceRel = "transactions", path = "transactions")
public interface TransactionsRepository extends PagingAndSortingRepository<Transactions, Integer>, JpaSpecificationExecutor<Transactions>,TransactionsRepositoryCustom{
}
my custom repository:
@Repository
public interface TransactionsRepositoryCustom {
TransactionReport getTrxAmtOnly(TrxFilter trxfilter);
}
my custom respository implementation:
@Repository
public class TransactionsRepositoryCustomImpl implements TransactionsRepositoryCustom{
@Autowired
@PersistenceContext
EntityManager entityManager;
@Override
public TransactionReport getTrxAmtOnly(TrxFilter filter){
Query totalAmt = entityManager.createQuery("SELECT pl FROM Transactions pl");
return null
}